Set the date format
How to Set the current data into Asp text box in asp.net :
In asp.net programming it is very simple that u set the current date in specific format .if u want to set the current date in time and date both the use:
Set Date:
TextBox1.Text=DateTime.Now.Date.ToString();here TextBox1 is the Textbox id and dateTime.Now is function.
we want to set the current date with time in Text property of text.
for this we use DateTime.Now.Date.ToString(); the current date set in textbox in String format.
If You want to want a specific format the Give format in to ToString() function as like,
TextBox1.Text=DateTime.Now.Date.ToString("dd-MMM-yyy");
Format DateTime:
Where
dd-MMM-yyy is a format of date :
- dd- refer to date ,
- MMM refer to Month,
- yyyy refer to Year.
Other Related Post :
- Post-back-data-processing.
- Server-controls-hierarchy
- Control-execution-life cycle
- Events-in-asp.net-server-controls
- Example of session in asp.net
- Session Management.
- Required Field validator.
- comparevalidator in asp.net
- Post back And call back
- What is the postback in asp.net
- Use of viewstate.
- Data Processing
- Web server Controls
- Exacution Lifecycle of Controls
- Asp.net CheckBoxList using jQuery
- JQuery UI Datepicker (Calendar) with asp.net textbox
- Get current datetime in jquery and javaScript
Asp.net related post And Examples:
- jQuery modal dialog with postbacks, Drag and Drop Sortable Lists using jQueryUI,jquery tooltip with css in asp.net web page, Asp.net Digital Clock with jQuery & CSS3,JQuery UI Datepicker (Calendar) with asp.net textbox
- Get current datetime in jquery and javaScript, jquery disable or Enable submit button after validation, Enable Disable Submit Button using jQuery, Limitation of Characters in Textbox or TextArea
- Limit Number of Characters in a TextArea using jQuery, Get selected radio button values using JQuery, How do you do html text encodes using JavaScript, Displaying the textbox value in javascript Messagebox, How to use alert and display textbox value by javascript
- jQuery Crop Image in Asp.net using Jcrop jQuery, How to create Temporary Table in ASP.Net using C#,Dynamically Create Temporary Table in Asp.net, Cropping image using jQuery in asp.net
- Checkboxlist control in asp net, Bind CheckBoxlist from database using jQuery,Checkboxlist in asp.net(control example),Asp-checkboxlist control demo, Asp checkboxlist Example using C#
- Asp.net checkboxlist control example,Asp.net RequiredFieldValidator validate to RadioButtonList,Validate ASP.Net RadioButtonList using JavaScript Example,Example of jQuery Validate on Radiobuttonlist in Asp.Net using C#
- Example jQuery Validate on CheckBoxList using C#,Check Uncheck all asp.net CheckBox in asp.net using jQuery, Check Uncheck all html CheckBox controls using jQuery:
- How to check If checkbox Is checked in asp.net, Add or bind tooltip for dropdownlist items in asp.net by C#, On mouse over event show tooltip dropdownlist items by using C# example,Display tooltip from database for dropdownlist items in asp.net c# example
Comments
Post a Comment