title: Disable weekends on calendarextender
body: <p>I would like to know if there is a simple solution to disable weekends from calendarextender in asp.net.</p>
  
  <p>I saw this:
  <a href="http://www.go4answers.com/Example/disable-weekends-ajax-calendar-extender-94762.aspx" rel="nofollow">first link</a><br>
  <a href="http://www.dotnetspider.com/forum/309731-How-disable-week-ends-ajax-calendar-extendar.aspx" rel="nofollow">second link</a></p>
  
  <p>But it didnt help me:</p>
  
  <pre><code>  &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;
  &lt;/asp:ScriptManager&gt;
  &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt;
  &lt;asp:CalendarExtender ID="CalendarExtender1" TargetControlID="TextBox1"  OnClientShown="DisableWeekends" runat="server"&gt;
  &lt;/asp:CalendarExtender&gt;
  
  &lt;script type="text/javascript"&gt;
      function DisableWeekends(sender, args)
      {
           for(var i=0; i&lt;sender._days.all.length; i++)
          {
                    for(var j=0; j&lt;6; j++)
                   {
                          if(sender._days.all[i].id == "calendarValidToDate_day_"+j+"_0")
                         {
                                sender._days.all[i].disabled = true;
                                sender._days.all[i].innerHTML = "&lt;div&gt;" +sender._days.all[i].innerText+ "&lt;/div&gt;";
                          }
  
                          if(sender._days.all[i].id == "calendarValidToDate_day_"+j+"_6")
                         {
                                  sender._days.all[i].disabled = true;
                                  sender._days.all[i].innerHTML = "&lt;div&gt;" +sender._days.all[i].innerText+ "&lt;/div&gt;";
                         }
                  }
           }
      }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Any tips?</p>