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

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!
 
M

mikeb

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.
 

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

Top