On the PreRender event of my page, I decide to do a response.redirect().
That means none of the javascript enclosed in <script language="JavaScript" type="text/javascript"> tags on that page are executed.
I wish to do the below :
String allJavaScript = MagicFunctionThatReturnsAllJSInTheControl(someUserControl)
ClientScript.RegisterClientScriptBlock("".GetType(), "s", allJavaScript );
Response.Redirect("~/newpage.aspx",false);
Do you know how would one code up, in C#/vb.net the MagicFunctionThatReturnsAllJSInTheControl(someUserControl)
Thanks
In light of your last comment, I think I have a possible solution, even if it does not answer your question as originally stated.
So, you want scripts in
currentpage.aspxto execute on the client even though you’re in the process of redirecting it tonewpage.aspx. In this situation, you can avoidResponse.Redirect()and perform the redirection on the client:This way, the client should load the page and execute the scripts within, then load
newpage.aspx. If you can stand the original page to be briefly visible while the redirected page loads, this might solve your problem.