473,406 Members | 2,336 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Global.asax Application_BeginRequest()

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
Sep 16 '08 #1
1 5762
On Sep 16, 2:25*pm, Greg <AccessVBA...@newsgroups.nospamwrote:
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
Sep 16 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Arjen | last post by:
Hi, I load my website settings inside the global.asax file. For this I have to use the context, to get the roles from the current browsing client. The problem is that there is no context at...
6
by: Prince | last post by:
I have a question about the global.asax.cs file. I'm reading info from a database to populate a DataGrid. I read somewhere that the opening of the database should occur in the global.asax.cs...
5
by: Victor Jones | last post by:
I had a question about accessing HttpContext.User in global.asax. I was trying to access HttpContext.User in Application_BeginRequest() which had a null value as opposed to containing a valid...
1
by: fd123456 | last post by:
Hi tshad, sorry for not coming back to you earlier. When I meant to add a method to Global.asax, I actually meant to add it to the code-behind file. If you click on "Global.asax" in the file...
9
by: tshad | last post by:
I have an example I copied from "programming asp.net" (o'reilly) and can't seem to get the Sub (writefile) to execute. It displays all the response.write lines that are called directly, but not...
7
by: Ankit Aneja | last post by:
I put the code for url rewrite in my Application_BeginRequest on global.ascx some .aspx pages are in root ,some in folder named admin and some in folder named user aspx pages which are in user...
19
by: furiousmojo | last post by:
This is a strange problem. I have a project where the contents of global.asax application_error are not firing. It is an asp.net 2.0 application using web application projects. I have another...
1
by: sai | last post by:
hi all, i have writen the following code in global.asax events and i have kept break points on following events to trace. protected void Session_Start(Object sender, EventArgs e) { ...
2
by: sai | last post by:
hi all, wt is the order of events that execute in global.asax file regards, sai
4
by: Joe | last post by:
Hello all! I added a Global.asax to my application. I'm using the Application_BeginRequest event. Everything works fine in my development enviorment but when I publish the web site the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.