All,
I am adding HTML controls with runat ="server" dynamically from my asp.net code.
<form id="frm1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" /></div>
<div runat="Server"> <asp:PlaceHolder ID="p1" runat="server"><%=strControl%></asp:PlaceHolder></div>
</form>
The code behind has
Public strControl as New string
strControl = "<input type=""hidden"" id=""test"" value=""test1"" runat=""server""/>"
Am able to view the input hidden control when the page is rendered. On click of submit button in page am writing a code like
Dim hdn1 as New HTMLInputHidden
hdn1 = Ctype(FindControl("test"), HTMLInputHidden)
But hdn1 always returns me nothing. is it possible to get the control in the code behind? I think there has to be something missing in my code. Can anyone help?
Thanks in advance.