title: Asp.net Ajax Single UpdatePanel + AnimationExtender + HIstory = No OnUpdated Animation
body: <p>I have a page that takes a while to load between partial post backs and have placed a UpdatePanelAnimationExtender to fade the updatepanel in and out.  Sample:</p>
  
  <p>Aspx
        </p>
  
  <pre><code>       &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always"  &gt;
          &lt;ContentTemplate&gt;
              &lt;asp:Button ID="testbtn" runat="server" Text="test" /&gt;
          &lt;/ContentTemplate&gt;
       &lt;/asp:UpdatePanel&gt;
  
      &lt;ajaxToolkit:UpdatePanelAnimationExtender ID="UpdatePanelAnimations" runat="server" TargetControlID="UpdatePanel1"&gt;
        &lt;Animations&gt;
          &lt;OnUpdating&gt; 
              &lt;FadeOut Duration="0.2" Fps="20" minimumOpacity=".3" /&gt;
           &lt;/OnUpdating&gt;
          &lt;OnUpdated&gt;
              &lt;FadeIn Duration="0.2" Fps="20" minimumOpacity=".3"/&gt;
          &lt;/OnUpdated&gt;
      &lt;/Animations&gt;
  &lt;/ajaxToolkit:UpdatePanelAnimationExtender&gt;
  </code></pre>
  
  <p>Code Behind</p>
  
  <pre><code>Private Sub testpage_Init(sender As Object, e As System.EventArgs) Handles Me.Init
      UpdatePanel1.ContentTemplateContainer.Controls.Add(New LiteralControl("1")) 'Show the init ran
  End Sub
  
  Private Sub btn_Click(sender As Object, e As System.EventArgs) Handles testbtn.Click
      ScriptManager.GetCurrent(Me.Page).AddHistoryPoint("2", "2", "2") 'Save Event
      UpdatePanel1.ContentTemplateContainer.Controls.Add(New LiteralControl("2")) 'Display event
  End Sub
  
  Private Sub sm1_Navigate(sender As Object, e As System.Web.UI.HistoryEventArgs) Handles sm1.Navigate
      Dim State As String = ""
      If e.State.HasKeys Then
          State = e.State.Item(0)
      End If
      UpdatePanel1.ContentTemplateContainer.Controls.Add(New LiteralControl(State)) '"Reload" event
  End Sub
  </code></pre>
  
  <p>When the page first loads you get
  Button 1</p>
  
  <p>When you click the button it saves the state and displays 
  Button 12</p>
  
  <p>And it does the fade in and out correctly.  If you take the URL with history information and try to load it in a new tab the Button 12 displays correctly but it remains faded out.  I had heard people say the OnUpdated will only run if a partialpostback has occured in reference to the page loading the first time.  I am guessing it is not faking partialpostback when loading by history so it never gets faded in.</p>
  
  <p>My question is there a clean way to fix this that I have just been able to find or am I stuck with injecting some javascript to call thr fade in manually?  For as simple as this problem seems to be I can find little to no help out there.</p>
  
  <p>Thanks</p>