Assign to a HTML textbox a value with asp.net

  • Thread starter Thread starter egsdar
  • Start date Start date
E

egsdar

I had to create a HTML textbox to add the date time but I don't know how to
assign the value with asp.net, how can I do that?

This is my HTM Textbox code:

<input id="txtFechaPlan" name="txtFechaPlan" style="width: 124px; position:
static" type="text" />

Thx
 
In other words, we can add runat="server" to --any-- HTML element and it can
then be parsed and compiled as an HTML Control. If you need to reference an
HTML Control it must be typed as HtmlGenericControl, i.e.

HtmlGenericControl textInput = FindControl("txtFechaPlan") as
HtmlGenericControl;

//search
html control site:msdn.microsoft.com
 
Thanks for the post, but I did as you suggest and it works, however, this
textbox is associated with a script and when I add the runat tag the
javascript doesn't work, this is the full aspx code:



<input id="txtFechaPlan" name="txtFechaPlan" style="width: 124px; position:
static" type="text" runat="server" />

<a href="javascript:NewCal('txtFechaPlan','yyyymmdd',true,24,'arrow')">

<img src="Images/date.png" style="position: static" border="0" /></a>



How can I make them both work?
 
Back
Top