title: How do I call javascript just before a response redirect
body: <p>I'm trying to run some java script just before a page redirect but it fails to run.
  When I comment out the Response.Redirect all works fine but this goes against the particular requirements. Any ideas on how to implement this functionality?</p>
  
  <pre><code>        Dim strscript As String = "&lt;script&gt;alert('hello');&lt;/script&gt;"
  
          If Not ClientScript.IsClientScriptBlockRegistered("clientscript") Then
              ClientScript.RegisterStartupScript(Me.GetType(), "clientscript", strscript)
          End If
  
          Response.Redirect("http://www.google.com")  
  </code></pre>