how to add class to a listitem from code behind
<p>I am dynamically generating paging from code behind but my html design is different. How to add a class to listitem. The code is as below</p>

<pre><code> if (pageCount &gt; 0)
    {
        pages.Add(new ListItem("First", "1", currentPage &gt; 1));
        for (int i = 1; i &lt;= pageCount; i++)
        {
            pages.Add(new ListItem(i.ToString(), i.ToString(), i != currentPage));
        }
        pages.Add(new ListItem("Last", recordCount.ToString(), currentPage &lt; pageCount));
    }
</code></pre>

<p>Html for the same is</p>

<pre><code> &lt;ul class="pages-pagina"&gt;
&lt;li class="pages previous"&gt;&lt;a href="#"&gt;Previous&lt;/a&gt;&lt;/li&gt;
&lt;li class="pages selected"&gt;&lt;a href="#"&gt;1&lt;/a&gt;&lt;/li&gt;
&lt;li class="pages"&gt;&lt;a href="#"&gt;2&lt;/a&gt;&lt;/li&gt;
&lt;li class="pages"&gt;&lt;a href="#"&gt;3&lt;/a&gt;&lt;/li&gt;
&lt;li class="pages"&gt;&lt;a href="#"&gt;4&lt;/a&gt;&lt;/li&gt;
&lt;li class="pages"&gt;&lt;a href="#"&gt;5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;li class="pages last"&gt;&lt;a href="#"&gt;10&lt;/a&gt;&lt;/li&gt;
&lt;li class="pages next"&gt;&lt;a href="#"&gt;Next&lt;/a&gt;&lt;/li&gt;


&lt;/ul&gt;
</code></pre>

<p>Thanks,</p>
