Global.asax Application_BeginRequest()

  • Thread starter Thread starter Greg
  • Start date Start date
G

Greg

I've been playing around with the Global.asax file and learning how it can
help me with my web application. I created an Application_EndRequest() method
with a Response.Write("Output"); line of code and it displays this text at
the bottom of "All" of my pages. So, I figured the Application_BeginRequest
will run "before" the page is loaded. It appears to work as I think and if I
place a Response.Write() method in it, it displays at the top of the page
before everything else. (I am just testing right now).

Anyway, all of my pages include a CSS Cascade Style Sheet. If I keep the
Response.Write() in the Application_BeginRequest method all of my pages loose
the CSS setup for them. Why are all of my pages loosing the CSS settings I've
setup? And, is there a way around this?

Thanks, Greg
 
I've been playing around with the Global.asax file and learning how it can
help me with my web application. I created an Application_EndRequest() method
with a Response.Write("Output"); line of code and it displays this text at
the bottom of "All" of my pages. So, I figured the Application_BeginRequest
will run "before" the page is loaded. It appears to work as I think and if I
place a Response.Write() method in it, it displays at the top of the page
before everything else. (I am just testing right now).

Anyway, all of my pages include a CSS Cascade Style Sheet. If I keep the
Response.Write() in the Application_BeginRequest method all of my pages loose
the CSS setup for them. Why are all of my pages loosing the CSS settings I've
setup? And, is there a way around this?

Thanks, Greg

Hi,

I do not think that you are using those method for theirs intended
use.
Take a look at the generated html in the browser and see where in the
document that response text is being placed. My bet is that it's ont
in the normal flow of the document.
That's why you are loosing the CSS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top