Suppose I have these both in my aspx file:
<asp:TextBox ID="tbASP" runat="server" Width="400px" />
<input id="tbHTML">
How to copy the content of tbHTML to tbASP from code behind?
Suppose I have these both in my aspx file:
<asp:TextBox ID="tbASP" runat="server" Width="400px" />
<input id="tbHTML">
How to copy the content of tbHTML to tbASP from code behind?
1.Add runat="server" to input..
<input id="tbHTML" runat="server">
you will access in code behind..
2.Else use find control
System.Web.UI.HtmlControls.HtmlInputControl tbHtml= this.FindControl("tbHtml") as System.Web.UI.HtmlControls.HtmlInputControl;
tbAsp.Text=tbHtml.value;
Make sure the Id of ur Input element is unique in page...than you can try like this.
tbASP.Text=Page.Request["tbHTML"].ToString();
Edit Vice Versa
<input id="id" value=<%= TextBox1.Text %> />