Monday, December 12, 2011

How to work with Calendar without using ASP.NET AJAX


In this Tutorial we are working with calendar, Textbox and ImageButton control and we are using the SelectedDate property to determine the selected date on the Calendar control.

A System.DateTime that represents the selected date. The default value is DateTime.MinValue.
 
Step 1:
file->New->Website(Calendar)

Step 2:
calendar.aspx page code split view
The SelectedDate property and the SelectedDates collection are updated before the SelectionChanged event is raised. You can override the date selection by using the OnSelectionChanged event handler to manually set the SelectedDate property. The SelectionChanged event does not get raised when this property is programmatically set.

Step 3:
calendar.aspx.cs page code
When the user selects a date on the Calendar control, the SelectionChanged event is raised. The SelectedDate property is updated to the selected date. The SelectedDates collection is also updated to contain just this date.

View in Browser
Before clicking Image Button

After clicking Image Button
Before Selecting Date from Calendar



No comments:

Popular Posts