Assign to a HTML textbox a value with asp.net

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
 
H

Hillbilly

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
 
E

egsdar

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top