<p>I have several &lt;li> elements with different id's on ASP.NET page:</p>

<pre><code>&lt;li id="li1" class="class1"&gt;
&lt;li id="li2" class="class1"&gt;
&lt;li id="li3" class="class1"&gt;
</code></pre>

<p>and can change their class using JavaScript like this:</p>

<pre><code>li1.className="class2"
</code></pre>

<p>But is there a way to change &lt;li> element class using ASP.NET? It could be something like:</p>

<pre><code>WebControl control = (WebControl)FindControl("li1");
control.CssClass="class2";
</code></pre>

<p>But FindControl() doesn't work as I expected. Any suggestions?</p>

<p>Thanks in advance!</p>

you must set runat="server" like:
```
```
<li id="li1" runat="server">stuff</li>
```
```