ASP.NET/C# How to access a list item of an unordered list using server runat =?
I have a ul list with a number of list items, for example:
<ul>
<li runat="server" id="liOne">one</li>
<li runat="server" id="liTwo">two</li>
<li runat="server" id="liThree">three</li>
</ul>
On page load, I need to set visible or invisible list items.
For some reason, I cannot access them in C # code. Also, no list items are created for the designer file. Anyone have any suggestions on how to get this to work?
I am getting this error:
The name 'liOne' does not exist in the current context
Many thanks.
+1
teisenhauer
a source
to share
2 answers