"caldera" <ca*****@cc.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
hi,
I want to add a script(window.open script actually) in global.asax, for
example Application_BeginRequest. I used Response.Write but opened page locked
however main page doesn't. Main page loaded normally.
How can I add a script in global.asax.
What are you trying to accomplish? Why would you want every single request
to get this window.open script?
If you absolutely must have every page begin with this code, then you should
create a base class for all of your pages to derive from. The base class
would derive from Page. It would have no UI. It should override the
OnPreRender method and add:
Protected Overrides Sub OnPreRender(e As EventArgs)
Page.RegisterStartupScript("common", "<script>window.open ...
</script>")
MyBase.OnPreRender(e)
End Sub
If all of your pages inherit from that base class, they'll all register the
same startup script.
--
John Saunders
johnwsaundersiii at hotmail