the following code is under gridview1, can't get the span's ID directly so i use findcontrol instead
<asp:TemplateField HeaderText="Reply">
<ItemTemplate>
<span id="convertsantionCount" class="label label-success"><%# Portal.Message.getConversationCount(Eval("ID").ToString())%></span>
</ItemTemplate>
</asp:TemplateField>
System.Web.UI.HtmlControls.HtmlGenericControl control = (System.Web.UI.HtmlControls.HtmlGenericControl) GridView1.FindControl("convertsantionCount");
control.Attributes["class"] = "badge badge-warning";
it says the control.Attributes["class"] Object reference not set to an instance of an object.
anyone would tell me how can i mannually change the class of the span. any way would do much thanks.