单击登录按钮后,它应该重定向到“Edit.aspx”。当它打开页面时,它只显示母版页中的内容。
这是 EnterSite.aspx 的代码:
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:Login ID="Login1" runat="server" DestinationPageUrl="Edit.aspx" OnAuthenticate="MyLogin_Authenticate">
</asp:Login>
</asp:Content>
这是后面的代码:
protected void MyLogin_Authenticate(object sender, AuthenticateEventArgs e)
{
string User = Login1.UserName;
string Pass = Login1.Password;
if (User == "Admin" && Pass == "Hello1234")
e.Authenticated = true;
}
这是 Edit.aspx 的代码:
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:Menu ID="ManageBlogPosts" runat="server" Text="Manage Blog Entries" NavigateUrl="ManageBlogPost.aspx"></asp:Menu>
<asp:Menu ID="ManageStreetPhotos" runat="server" Text="Manage Street Photos" NavigateUrl="ManageStreetPhotos.aspx"></asp:Menu>
<asp:Menu ID="ManagePeoplePhotos" runat="server" Text="Manage People Photos" NavigateUrl="ManagePeoplePhotos.aspx"></asp:Menu>
</asp:Content>