Currently, I am utilizing the Ajax calendar extender to enable selection of multiple dates.
<Ajax:CalendarExtender ID="CalendarExtender2" runat="Server"
BehaviorID="CalendarExtender2" TargetControlID="TextBox8"
PopupButtonID="Image1" OnClientDateSelectionChanged="dateselect" OnClientHidden="calendarhidden" OnClientShown="setInitialValue"/>
The following code snippet represents the JavaScript code being used:
function dateselect(cntrl) {
var calendarBehavior1 = $find("CalendarExtender2");
var date = calendarBehavior1._selectedDate.format("M/dd/yyyy");
var hiddencontrol = $get('<%=HiddenField1.ClientID %>');
if (hiddencontrol.value.indexOf(date) == -1)
hiddencontrol.value += date + ";";
tag1 = 1;
}
function calendarhidden(cntrl) {
var calendarBehavior = $find("CalendarExtender2");
if (tag1 == 1)
calendarBehavior.show();
$get('<%=TextBox8.ClientID %>').value = $get('<%=HiddenField1.ClientID %>').value;
}
However, my aim is to create these JavaScript functions in a more generalized manner so that they can be applied to other calendar extenders as well. If I pass this as an argument like this:
OnClientDateSelectionChanged="dateselect(this)"
I am seeking guidance on how to find the behavior ID using this approach. Your assistance on this matter would be greatly appreciated.