Confirm Backdating
I have a calendar control. If the user wants to backdate (ie, SelectedDate < Today), then I want to display a confirm messagebox asking the user: 'Are you sure you want to backdate?'
Calendar Control has a OnDayRender event that you can handle. In the eventhandler, for all date before today's date, add the javascript: confirm() function to the OnClick attribute as follows:
protected void cal_DayRender(object sender, DayRenderEventArgs e) { if(e.Day.Date < DateTime.Today) e.Cell.Attributes.Add("OnClick", "return confirm('Are you sure you want to backdate?');"); }
Posted by Vijay on 15-Sep-2009 03:18 AM
Category : ASP.NET WebForms
Category : ASP.NET WebForms
Commented by
Rahul at 10-Feb-2010 05:15 AM
Can you provide more clarity on this??


