title: ClientScript.RegisterClientScriptBlock works only in PageLoad event
body: <p>I'm trying to register a simple script -</p>
  
  <pre><code>ClientScript.RegisterClientScriptBlock(typeof(Page), "myscript", "&lt;script&gt;testfun();&lt;/script&gt;");
  </code></pre>
  
  <p>This line works fine when I put it in the page load event. However, everytime the user selects a row in the gridview, I need some client side function to get executed, hence in the GridView.SelectedIndexChanged event, I added the same line, however, it doesn't work there. Can anyone point out why this happens or direct me towards a more elegant solution?</p>