Click here to Skip to main content
15,891,375 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
sir,
please explain how to visible date in textbox using asp.net c#?
Posted
Comments
Ramug10 19-Feb-14 7:42am    
are you want to show date in textbox provide me more details of your problem?

In your Page Load event handler:
C#
myDateTextBox.Text = DateTime.Now.ToString();
 
Share this answer
 
Convert your database datetime to string and set Textbox.Text your string like this -
YourTextBox.Text = DateTime.Now.ToString();
 
Share this answer
 
C#
myTxt.Text = DateTime.Now.ToString();
myTxt.Text = DateTime.Now.ToShortDateString();

And what not you can do with DateTime.Now[^].
Just get the date and assign it to the TextBox. As simple as that :)

-KR
 
Share this answer
 
Use below code in your page_load event of your Asp.Net page.

txtDate.Text = DateTime.Now.Date.ToShortDateString();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900