Using the Ajax Control Toolkit, you can build Ajax-enabled ASP.NET Web Forms applications by drag and drop Toolkit controls from the Visual Studio Toolbox onto an ASP.NET Web Forms page. Ajax toolkit has a CalendarExtender control which is very easily you can associate with a TextBox Control as well as a Button control.

The following Asp.Net Ajax program validate a Date input from Ajax CalendarExtender control and shows the message to the client user. The validation performed by using JavaScript in the client side coding.
function verifyDate(sender,args){ var d = new Date(); d.setDate(d.getDate() - 1); if (sender._selectedDate < d) { alert("Date should be Today or Greater than Today"); sender._textbox.set_Value('') } }
You can copy and paste the following source code and run the program. To use the Ajax Control Toolkit in your Visual Studio project, you should add reference to the AjaxControlToolkit.dll in your project.
Default.aspx
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %> Untitled Page
ASP.NET Ajax - Related Contents
Advertisement
ASP.NET Related Topics