title: How to find behavior ID in Ajax calendar extender
body: <p>I am using Ajax calender extender for selecting multiple dates.</p>
  
  <pre><code>    &lt;Ajax:CalendarExtender ID="CalendarExtender2" runat="Server"  
  BehaviorID="CalendarExtender2"  TargetControlID="TextBox8"  
  PopupButtonID="Image1" OnClientDateSelectionChanged="dateselect" OnClientHidden="calendarhidden" OnClientShown="setInitialValue"/&gt;
  </code></pre>
  
  <p>This is the Java script code.</p>
  
  <pre><code>function dateselect(cntrl) {
  
      var calendarBehavior1 = $find("CalendarExtender2");
      var date = calendarBehavior1._selectedDate.format("M/dd/yyyy");
      var hiddencontrol = $get('&lt;%=HiddenField1.ClientID %&gt;');
      if (hiddencontrol.value.indexOf(date) == -1)
          hiddencontrol.value += date + ";";
      tag1 = 1;
  }
  
  function calendarhidden(cntrl) {
  
      var calendarBehavior = $find("CalendarExtender2");
      if (tag1 == 1)
          calendarBehavior.show();
      $get('&lt;%=TextBox8.ClientID %&gt;').value = $get('&lt;%=HiddenField1.ClientID %&gt;').value;
  }
  </code></pre>
  
  <p>But thing is I want to make these java script functions generalized one. So that I can use for other calender extender.
  IF I am passing <strong>this</strong> </p>
  
  <p><code>OnClientDateSelectionChanged="dateselect(this)"</code></p>
  
  <p>How to find behavior ID using this? Please help on this.</p>