Access Html control in code behind
Posted on 2009-07-10
I usually use all asp control but supporting others code and I need to know how to access a html control in my code behind. Here is the control name
<DIV id="divAdmin" style="DISPLAY: inline"></DIV>
I put the run at server
<DIV id="divAdmin" style="DISPLAY: inline" runat="server"></DIV>
it shows up in code behind as such
Protected WithEvents divAdmin As System.Web.UI.HtmlControls.HtmlGenericControl
But when I try to get the text of the control I cannot access it when I do a
Dim Name as string = divAdmin ?????
nothing I choose lets me get the text in there.