特定页面未显示任何内容
本文关键字:显示 任何内 | 更新日期: 2023-09-27 18:31:36
我点击登录按钮后,它应该重定向到"编辑.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>
要使菜单使用以下命令:
<asp:Menu ID="ManageBlogPosts" runat="server" Text="Manage Blog Entries" NavigateUrl="ManageBlogPost.aspx">
<Items>
<asp:MenuItem NavigateUrl="~/a.aspx" Text="a" Value="a"></asp:MenuItem>
<asp:MenuItem NavigateUrl="~/b.aspx" Text="b" Value="b"></asp:MenuItem>
<asp:MenuItem NavigateUrl="~/c.aspx" Text="c" Value="c"></asp:MenuItem>
</Items>
</asp:Menu>