You can use a Label
instead of a html-span (which is also rendered as span) or you could add runat="server"
. Setting runat="server"
allows you to access the HTML element in the code behind just as any other server control, via its ID.
<span id="expTrainingShow" runat="server" class="clsLink" style="margin-left: 20px;" onclick="GridChanger();" ></span>
somewhere in codebehind(the span is a HtmlGenericControl
on serverside):
expTrainingShow.InnerHtml = yourText ' set the text '
or
expTrainingShow.Visible = False ' hide it '
Note that Visible=False
on serverside means that the control is not rendered at all on clientside, hence it does not exist in the html and can be accessed only on serverside.
If you just want to hide it but render it anyway, you should use CSS or expTrainingShow.Style.Add("display","none")
.