title: Obout Calendar in UpdatePanel messes up after asynchronous postback
body: <p>I am currently trying to implement a date range search function using Obout Calendar controls. The idea is that the user can select a date from the Obout calendar which will then fill a asp:TextBox beside it. There are other fields in the form, but this is the one that's breaking. I also have a asp:Button at the bottom of the form who's function is to clear all fields in the form. It does this in the code behind with this:</p>
  
  <pre><code>protected void btnClearFields_Click(object sender, EventArgs e)
  {
      txtFrom.Text = "";
      txtTo.Text = "";
  }
  </code></pre>
  
  <p>And here is the relevant front end code:</p>
  
  <pre><code>&lt;table&gt;
      &lt;tr&gt;
          &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
              &lt;ContentTemplate&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="lblFrom" runat="server" Text="From:"&gt;&lt;/asp:Label&gt;
                      &lt;br /&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="txtFrom" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;obout:Calendar runat="server" ID="CalendarFrom" TextBoxId="txtFrom" StyleFolder="Calendar/styles/orbitz" ScriptPath="Calendar/calendarscript" DatePickerButtonText &lt;IMG src='Images/calendar.gif' align=absMiddle border=0&gt;" ShowYearSelector="true" DateMin="1/1/1900" AllowDeselect="false" DatePickerMode="true" /&gt;
                  &lt;/td&gt;
              &lt;/ContentTemplate&gt;
          &lt;/asp:UpdatePanel&gt;
          &lt;asp:UpdatePanel ID="UpdatePanel2" runat="server"&gt;
              &lt;ContentTemplate&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="lblTo" runat="server" Text="To:"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="txtTo" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;obout:Calendar runat="server" ID="CalendarTo" TextBoxId="txtTo" StyleFolder="Calendar/styles/orbitz" ScriptPath="Calendar/calendarscript" DatePickerButtonText &lt;IMG src='Images/calendar.gif' align=absMiddle border=0&gt;" ShowYearSelector="true" DateMin="1/1/1900" AllowDeselect="false" DatePickerMode="true" /&gt;
                  &lt;/td&gt;
              &lt;/ContentTemplate&gt;
          &lt;/asp:UpdatePanel&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Now, the problem I am having is that when I first load the page, all is well. I can select a date from the calendars and it will fill in the text boxes as expected. However, if I click the "Clear Fields" button, which causes a partial postback, then things go wrong. When I go to click on the calendar icon again (after the fields have been cleared), the formatting of the date selector that pops up is messed up. The calendar portion of it is just a red square, can't select any dates. The year selector bar stretches across the entire screen, and changing the year doesn't do anything for the calendar. </p>
  
  <p>I couldn't find any similar problems in my research, so I am not sure what to try. I have tried using only one UpdatePanel around the entire table, but then I get the same problem. I have also tried not including the calendar in the UpdatePanels, which will not "break" the calendars, but it will put two new TextBox fields on my webpage (which will accept any new values from the calendar) and not clear the old ones. Also tried putting both the button and the table containing the calendar in the same UpdatePanel, but I get the same red box there too.</p>