This should be a fairly simple question
At some point in my code I am doing a Server.Transfer to a different page
In the new page, there is a call (the details are irrelevant)
Page.ClientScript.RegisterStartupScript(GetType(), name, js, true);
However, this javascript never appears on the page.
Although this question is very old, I faced the same problem and as this question appeared on google top for me, I will share my solution.
For me the problem was in this line (vb.net)
it should be
and then you use
The trick is that HttpContext.Current.Handler refers to the page before server transfer, and HttpContext.Current.CurrentHandler to the currently executing page: http://msdn.microsoft.com/en-us/library/system.web.httpcontext.currenthandler(v=vs.110).aspx