Last post Dec 04, 2013 11:01 PM by kellywong911
Nov 27, 2013 11:57 PM|kellywong911|LINK
the following code is under gridview1, can't get the span's ID directly so i use findcontrol instead
<span id="convertsantionCount" class="label label-success"><%# Portal.Message.getConversationCount(Eval("ID").ToString())%></span>
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.
Nov 28, 2013 12:24 AM|prakashslm|LINK
Is possible for you to try with asp:Label. After rendering asp:Label will be as span tag until we assign the
AssociatedControlID it will be span. when we assign
AssociatedControlID it will be render as label.
Nov 28, 2013 10:39 PM|chetan.sarode|LINK
add runat=server to span
Dec 04, 2013 11:01 PM|kellywong911|LINK
doesnt work its inside lots of layers
cant even use find control thanks for reply