I want to create a website where, if the administrator logs in via admin.aspx
I want to add another navigation to my menu list. my menu list consists of <ul>...<li>ie html control since I can dynamically add new ones
in my main page menu or else first I add an admin menu and apply style { visibility:hidden}
and when the login is successful, I want to change it to{visibility:visible }this is my homepage code
<ul id="ul_myLst" runat="server">
<li><a href="Testimonials.aspx">Testimonial</a>
</li>
<li><a href="#fakelink">Contact Us</a>
</li>
<li><a href="#fakelink">About Us</a>
</li>
<li><a href="Registration.aspx">Registartion</a>
</li>
<li><a href="OurFaculty.aspx">Our Faculty</a>
</li>
<li id="abc" runat="server" style="visibility:hidden">
<a href="OurFaculty.aspx">Admin</a>
</li>
</ul>
and this is my code Default.aspx
if (f.pass.Equals(txtpass.Value)) {
HtmlGenericControl ul = (HtmlGenericControl)(this.Master.FindControl("abc"));
//ul.Attributes["class"] = "admin-p";
ul.Style.Remove("visibility");
ul.Style["visibility"] = "visible";
Response.Redirect("Index.aspx");
}
this code works fine, but when I go back to index.aspx, the admin menu is automatically hidden
source
share