Working with Ajax Calender Extender with dd/mm/yyyy Validation

developerscode

Hi friends,In this article i would like to explain "How to use Ajax calendar Extender in Asp.Net applications" .Here we are displaying date in dd/mm/yyyy Format.First we need to add AjaxControlToolkit to your
Application.click here to know the procedure of adding Ajax Toolkit to your applications.

Open the Default.aspx and select one Textbox from Toolbox and write the following code



 



Next apply the Regular and Required Field validations for

*
                    
 * 


Now,the Date will be display in dd/mm/yyyy Format.When we are inserting date in database we need to change in MM/dd/yyyy Format.
write the following code to change the date

string[] RawDate = txtDate.Text.Split('/');
string[] datearr = { RawDate[1], RawDate[0], RawDate[2] };
string date = datearr[0] + "/" + datearr[1] + "/" + datearr[2];


That's it...
developercode
About the Author
Sayyad is a Software Engineer, Blogger and Founder of Developers Code from India.His articles mainly focus on .Net (Web and Windows based applications), Mobile Technologies (Android,IPhone,BlackBerry) and SEO.

Facebook Rss Twitter

Get Weekly News letter of Updates!