Help needed with filling a textbox with current day...ty

  • Thread starter Thread starter TN Bella
  • Start date Start date
T

TN Bella

This sounds so simple...I want the textbox to automatically fill with
today's date but how is that done? I want to use this information to
send to a SQL table later so I want it displayed in a textbox...Thanks
in advance for the help

<asp:textbox id="RptDate" runat="server" Width="200px">

Someone suggested using: RptDate.Text = DateTime.Now.ToString() for
behind the code

But I am not using the behind the code, I am WebMatrix and not VS.net.
Can someone assist me on how to get this to work?

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
TN said:
This sounds so simple...I want the textbox to automatically fill with
today's date but how is that done? I want to use this information to
send to a SQL table later so I want it displayed in a textbox...Thanks
in advance for the help

<asp:textbox id="RptDate" runat="server" Width="200px">

Someone suggested using: RptDate.Text = DateTime.Now.ToString() for
behind the code

But I am not using the behind the code, I am WebMatrix and not VS.net.
Can someone assist me on how to get this to work?

WebMatrix lets you put your code in-line in the .aspx file:

<script runat="server">
public void Page_Load() {
RptDate.Text = DateTime.Now.ToString();
}
</script>

Surely webMatrix has some examples that you can study so you can expand
and refine this.
 
Back
Top