"egsdar" <eg****@discussions.microsoft.comwrote in message
news:73**********************************@microsof t.com...
>Change the client-side markup to:
<input type="text" id="txtFechaPlan" runat="server"
style="width:124px;position:static;" />
Add the following to the code-behind, probably in the Page_Load event:
txtFechaPlan.Text = DateTime.Now.ToString("dd MMM yyyy HH:mm");
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>
As a general rule, when posting to a technical newsgroup, there is very
little point in saying simply that something "doesn't work" if you don't
actually say why it doesn't work, what error messages you are getting etc.
That will help us to help you. All I can do now is guess why it doesn't
work...
Firstly, remove the name="txtFechaPlan" tag, as I originally advised e.g.
<input type="text" id="txtFechaPlan" runat="server"
style="width:124px;position:static" />
Then try this:
<a
href="javascript
:NewCal('<%=txtFechaPlan.ClientID% >','yyyymmdd',true,24,'arrow')">
As mentioned, I can't guarantee this will solve your problem because you
haven't explained what your problem is...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net