title: Call a Javascript Function after UpdatePanel Postback Issue
body: <p>I basically have in my <code>UpdatePanel</code> a literal that generates a Javascript array based on a method in my codebehind.</p>
  <p>I don't have an issue when it comes to loading my content on page load. But if I try and carry out a search to update my Javascript array literal within my <code>UpdatePanel</code>, I found that the literal gets updated on postback after the Javascript has already fired.</p>
  <p>Here is a basic example of what I have:</p>
  <pre><code>&lt;script type=&quot;text\javascript&quot;&gt;
  function BindMyFunction(itemList)
  {
      //Do something
  }
  &lt;/script&gt;
  
  &lt;asp:UpdatePanel ID=&quot;UpdatePanel1&quot; runat=&quot;server&quot;&gt;
  &lt;ContentTemplate&gt;  
  &lt;!-- Literal containing generated JS array --&gt;
      &lt;asp:Literal ID=&quot;ProfileJavscriptOutput&quot; runat=&quot;server&quot;&gt;&lt;/asp:Literal&gt; 
      &lt;ul id=&quot;person-search&quot;&gt;
      &lt;li&gt;&lt;asp:TextBox ID=&quot;TxtFirstname&quot; runat=&quot;server&quot; Text=&quot;&quot;&gt;&lt;/asp:TextBox&gt;&lt;/li&gt;
      &lt;!-- Update Literal onClick --&gt;
          &lt;li&gt;&lt;asp:ImageButton CssClass=&quot;searchbtn&quot; ID=&quot;ImageButton1&quot; runat=&quot;server&quot; OnClick=&quot;ImageButton1_Click&quot; /&gt;&lt;/li&gt;
      &lt;/ul&gt;    
      &lt;!-- Some jCarousel rendered --&gt;
  &lt;/asp:UpdatePanel&gt;
  </code></pre>
  <p>I've been looking at the following posts:</p>
  <p><a href="https://stackoverflow.com/questions/418072/asp-net-updatepanel-and-javascript">ASP.NET - UpdatePanel and JavaScript</a></p>
  <p><a href="https://stackoverflow.com/questions/4941156/call-javascript-after-updatepanel-postback">call javascript after updatepanel postback</a></p>
  <p>But I can't seem to apply it correctly to my code.</p>
  <p>It works fine when I don't use an <code>UpdatePanel</code>. But it is a requirement so that the page position does not move when searches are carried out.</p>