Ho to access the HTML control
-
Hi Friends, I have a query, how can we access the HTML control from ASP.NET code behind. "FindControl" is throwing error. Thanks in advance Sheel Gohe
-
Hi Friends, I have a query, how can we access the HTML control from ASP.NET code behind. "FindControl" is throwing error. Thanks in advance Sheel Gohe
Is the element marked with the attribute
runat="server"
? -
Hi Friends, I have a query, how can we access the HTML control from ASP.NET code behind. "FindControl" is throwing error. Thanks in advance Sheel Gohe
Read this please. -------------------------------------------------------- My development blog Q:What does the derived class in C# tell to it's parent? A:All your base are belong to us!
-
Is the element marked with the attribute
runat="server"
?No mike its not marked with the attribute runat="server"? its purely a html control " Any solutions.... Sheel Gohe
-
No mike its not marked with the attribute runat="server"? its purely a html control " Any solutions.... Sheel Gohe
-
No mike its not marked with the attribute runat="server"? its purely a html control " Any solutions.... Sheel Gohe
If you want to manipulate a server control or HTML element through server-side code, you must mark the element with the attribute
runat="server"
. In your case, you could certainly have the following:<input type="checkbox" id="chkSelect" runat="server"/>
Server-side then, the
chkSelect
object would be identified as the typeSystem.Web.UI.HtmlControls.HtmlInputCheckBox
, and you could inspect or manipulate it's properties (lookup HtmlInputCheckBox on MSDN for a reference). You could certainly use a<asp:Checkbox id="chkSelect" runat="server"/>
control instead. Any reason you're not?