asp.NET If then inside of DIV tag?
I have two menus based on someones credentials.
The menu is an UL within a wrapping DIV and I would like to place an If Then within that DIV to set is class dynamically.
Does anyone know if this is possible or if there is a better appr开发者_StackOverflow社区oach?
Thanks in advance!
Give the element an id and add the runat="server" attribute to it. You can now access if from your code and set its attributes programmatically.
If its just a div, you can use asp:Panel instead -- asp:Panel will render a Div, and you can set its visibility in your code behind
Scratch that, actually that wont work.
I need to hide a specific list item and so what I will simply do is write that list item dynamically when the correct user is logged in.
精彩评论