title: jquery ajax tabs error on refresh or postback
body: <p>I'm implementing jquery tabs in a current project, and wanting to load one aspx page via the ajax load ability that contains a user control inside an updatepanel.  The page I'm calling uses the querystring to determine its content depending on the tab clicked.  On loading the document. ready function in the ajax loaded page has a <code>settimeout</code> function that causes a <code>__dopostback</code> on the updatepanel to refresh the data.  </p>
  
  <p>The pages will load fine, but the <code>settimeout</code> function (with or without the <code>__dopostback</code>) causes an  <strong>Unknown runtime error</strong> on line - <strong>updatePanelElement.innerHTML = rendering</strong>; , attempting to refresh the page causes a <strong>Sys.ArgumentTypeException: Object of type 'Sys._Application' cannot be converted to type 'Sys._Application' error</strong>.  Depending on how many tabs you've switched between - this error will then be presented the same amount of times, I've seen some comments it may be a garbage collection issue??  Other errors via firebug are: <code>Sys.Observable is null</code>, <code>clearEventsHandler is null</code>.</p>
  
  <p>The page I'm loading has all the jquery libraries, a scriptmanager and one plugin named shadowbox.  removing the plugin doesn't affect it.  either does changing the scriptmode on the scriptmanager.  I'm using jquery ui 1.8.11 and jquery core 1.5. </p>
  
  <p>My tabs setup looks like this (without the uls etc)</p>
  
  <pre><code>        &lt;li&gt;&lt;a href="/pmcbedman/Pages/RoomHolder.aspx?ward=2"&gt;&lt;span&gt;Ward 2&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="/pmcbedman/Pages/RoomHolder.aspx?ward=3"&gt;&lt;span&gt;Ward 3&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="/pmcbedman/Pages/RoomHolder.aspx?ward=7"&gt;Ward 7&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="/pmcbedman/Pages/RoomHolder.aspx?ward=9"&gt;Ward 9&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="/pmcbedman/Pages/RoomHolder.aspx?ward=ICU"&gt;ICU&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>here's the tabs call done from the masterpage:</p>
  
  <pre><code>        $(function () {
  
          $("#tabs").tabs({ cache: false, ajaxOptions: { success: function () { }, cache: false, error: function (xhr, status, index, anchor) { $(anchor.hash).html("Couldn't load this tab"); } } });
          });
  </code></pre>
  
  <p>Haven't found anything on the web resembling this - at least not with a solution attached that's worked - has anyone got any ideas??</p>