James_fl
asked on
Setting the visible property of a list item
Hi, I have an <ul> which has several <li> inside. My question is: How do I hide / show a specific <li> without creating one <ul> for one <li>, putting the <ul> inside a panel and setting the visible property of that panel?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
so it will be like this:
<asp:Literal id="li1" runat="server" Text="<li><asp:linkbutton id=""btn"" runat=""server"">Link 1</asp:linkbutton></li>"
If I do that, can I manipulate the btn in Visual Studio?
<asp:Literal id="li1" runat="server" Text="<li><asp:linkbutton id=""btn"" runat=""server"">Link 1</asp:linkbutton></li>"
If I do that, can I manipulate the btn in Visual Studio?
i don't think so
the Text property can accept and render only pure html
i've checked and saw ( i didn't know that it is possible )
<ul runat="server" id="as">
<li runat="server" id="as2">assa
<asp:HyperLink Runat="server" NavigateUrl="asss" id="we">123</asp:HyperLink ></li></ul >
HTH
B..M
the Text property can accept and render only pure html
i've checked and saw ( i didn't know that it is possible )
<ul runat="server" id="as">
<li runat="server" id="as2">assa
<asp:HyperLink Runat="server" NavigateUrl="asss" id="we">123</asp:HyperLink
HTH
B..M
Are you trying to programmatically decide, from the code-behind file, which <li> elements to display or not display?
Or are you trying to provide the ability to hide/show <li> elements dynamically within the browser (without PostBack) based on some user actions?
Or are you trying to provide the ability to hide/show <li> elements dynamically within the browser (without PostBack) based on some user actions?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thogek, your solution works. thanks..
mmarinov, I tried your second solution but it didn't work since it can't find the control. But since your first solution works and it actually answered my question (my fault for not asking specifically), I'll give you also a portion of the point
MOD, please split the point and give 100 point to mmarinov.
mmarinov, I tried your second solution but it didn't work since it can't find the control. But since your first solution works and it actually answered my question (my fault for not asking specifically), I'll give you also a portion of the point
MOD, please split the point and give 100 point to mmarinov.
ASKER
I need to put a link button on the list. If I put an <asp:linkbutton> tag inside the text attribute, will it render properly?
James