473,387 Members | 1,516 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,387 software developers and data experts.

How to stop processing request in global.asax

GS
What would be the sample code to stop processing any further requests in
Application_onStart within global.asax has failed? Response.End does not
work since there is no response object at the point of initializion.
Jan 7 '06 #1
8 9269
OnStart happens before any request is in the pipeline.

Personally, I'd stick a value in the web.config and read said value in
BeginRequest. if it's true, I'd simply Response.End there.

Karl

--
http://www.openmymind.net/

"GS" <no@no.com> wrote in message
news:un**************@TK2MSFTNGP12.phx.gbl...
What would be the sample code to stop processing any further requests in
Application_onStart within global.asax has failed? Response.End does not
work since there is no response object at the point of initializion.

Jan 7 '06 #2
in 2.0 you can also use an App_Offline.htm file, take a look at:
http://weblogs.asp.net/eporter/archi...05/426708.aspx

Karl

--
http://www.openmymind.net/

"GS" <no@no.com> wrote in message
news:un**************@TK2MSFTNGP12.phx.gbl...
What would be the sample code to stop processing any further requests in
Application_onStart within global.asax has failed? Response.End does not
work since there is no response object at the point of initializion.

Jan 7 '06 #3
GS
So how exactly I do that?
I don't know which page will be access first so in which page
"begin_request" event I need to put this in?
Generally what is prefered way to handle application initialization failures
in ASP.NET?

G
"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
OnStart happens before any request is in the pipeline.

Personally, I'd stick a value in the web.config and read said value in
BeginRequest. if it's true, I'd simply Response.End there.

Karl

--
http://www.openmymind.net/

"GS" <no@no.com> wrote in message
news:un**************@TK2MSFTNGP12.phx.gbl...
What would be the sample code to stop processing any further requests in
Application_onStart within global.asax has failed? Response.End does not
work since there is no response object at the point of initializion.


Jan 7 '06 #4
Begin Request is an event of the Global.asax

Karl

--
http://www.openmymind.net/

"GS" <no@no.com> wrote in message
news:uh*************@TK2MSFTNGP10.phx.gbl...
So how exactly I do that?
I don't know which page will be access first so in which page
"begin_request" event I need to put this in?
Generally what is prefered way to handle application initialization
failures in ASP.NET?

G
"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
OnStart happens before any request is in the pipeline.

Personally, I'd stick a value in the web.config and read said value in
BeginRequest. if it's true, I'd simply Response.End there.

Karl

--
http://www.openmymind.net/

"GS" <no@no.com> wrote in message
news:un**************@TK2MSFTNGP12.phx.gbl...
What would be the sample code to stop processing any further requests in
Application_onStart within global.asax has failed? Response.End does not
work since there is no response object at the point of initializion.



Jan 7 '06 #5
GS
Thanks,

I use VS 2005 and it does not have this event when it created global.asax.
"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
Begin Request is an event of the Global.asax

Karl

--
http://www.openmymind.net/

"GS" <no@no.com> wrote in message
news:uh*************@TK2MSFTNGP10.phx.gbl...
So how exactly I do that?
I don't know which page will be access first so in which page
"begin_request" event I need to put this in?
Generally what is prefered way to handle application initialization
failures in ASP.NET?

G
"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
OnStart happens before any request is in the pipeline.

Personally, I'd stick a value in the web.config and read said value in
BeginRequest. if it's true, I'd simply Response.End there.

Karl

--
http://www.openmymind.net/

"GS" <no@no.com> wrote in message
news:un**************@TK2MSFTNGP12.phx.gbl...
What would be the sample code to stop processing any further requests
in Application_onStart within global.asax has failed? Response.End does
not work since there is no response object at the point of
initializion.



Jan 7 '06 #6
but you found it, right?

Karl

--
http://www.openmymind.net/

"GS" <no@no.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Thanks,

I use VS 2005 and it does not have this event when it created global.asax.
"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
Begin Request is an event of the Global.asax

Karl

--
http://www.openmymind.net/

"GS" <no@no.com> wrote in message
news:uh*************@TK2MSFTNGP10.phx.gbl...
So how exactly I do that?
I don't know which page will be access first so in which page
"begin_request" event I need to put this in?
Generally what is prefered way to handle application initialization
failures in ASP.NET?

G
"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
OnStart happens before any request is in the pipeline.

Personally, I'd stick a value in the web.config and read said value in
BeginRequest. if it's true, I'd simply Response.End there.

Karl

--
http://www.openmymind.net/

"GS" <no@no.com> wrote in message
news:un**************@TK2MSFTNGP12.phx.gbl...
> What would be the sample code to stop processing any further requests
> in Application_onStart within global.asax has failed? Response.End
> does not work since there is no response object at the point of
> initializion.
>



Jan 7 '06 #7
GS
Yes,

Thanks for all your help.
The problem now is that BeginRequest is being executed for each new request
coming in and I want to stop processing anything if stuff in
Application_onStart was not initialized properly so BeginRequest is not
really a choice here.

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:ey**************@TK2MSFTNGP11.phx.gbl...
but you found it, right?

Karl

--
http://www.openmymind.net/

"GS" <no@no.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Thanks,

I use VS 2005 and it does not have this event when it created
global.asax.
"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
Begin Request is an event of the Global.asax

Karl

--
http://www.openmymind.net/

"GS" <no@no.com> wrote in message
news:uh*************@TK2MSFTNGP10.phx.gbl...
So how exactly I do that?
I don't know which page will be access first so in which page
"begin_request" event I need to put this in?
Generally what is prefered way to handle application initialization
failures in ASP.NET?

G
"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO .
ANDME net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
> OnStart happens before any request is in the pipeline.
>
> Personally, I'd stick a value in the web.config and read said value in
> BeginRequest. if it's true, I'd simply Response.End there.
>
> Karl
>
> --
> http://www.openmymind.net/
>
>
>
> "GS" <no@no.com> wrote in message
> news:un**************@TK2MSFTNGP12.phx.gbl...
>> What would be the sample code to stop processing any further requests
>> in Application_onStart within global.asax has failed? Response.End
>> does not work since there is no response object at the point of
>> initializion.
>>
>
>



Jan 8 '06 #8
Store a value in the Application object in Start, and check it during
BeginRequest...not sure how else you'll be able to do it..

Karl

--
http://www.openmymind.net/

"GS" <no@no.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Yes,

Thanks for all your help.
The problem now is that BeginRequest is being executed for each new
request coming in and I want to stop processing anything if stuff in
Application_onStart was not initialized properly so BeginRequest is not
really a choice here.

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:ey**************@TK2MSFTNGP11.phx.gbl...
but you found it, right?

Karl

--
http://www.openmymind.net/

"GS" <no@no.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Thanks,

I use VS 2005 and it does not have this event when it created
global.asax.
"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
Begin Request is an event of the Global.asax

Karl

--
http://www.openmymind.net/

"GS" <no@no.com> wrote in message
news:uh*************@TK2MSFTNGP10.phx.gbl...
> So how exactly I do that?
> I don't know which page will be access first so in which page
> "begin_request" event I need to put this in?
> Generally what is prefered way to handle application initialization
> failures in ASP.NET?
>
> G
>
>
> "Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO .
> ANDME net> wrote in message
> news:%2****************@TK2MSFTNGP11.phx.gbl...
>> OnStart happens before any request is in the pipeline.
>>
>> Personally, I'd stick a value in the web.config and read said value
>> in BeginRequest. if it's true, I'd simply Response.End there.
>>
>> Karl
>>
>> --
>> http://www.openmymind.net/
>>
>>
>>
>> "GS" <no@no.com> wrote in message
>> news:un**************@TK2MSFTNGP12.phx.gbl...
>>> What would be the sample code to stop processing any further
>>> requests in Application_onStart within global.asax has failed?
>>> Response.End does not work since there is no response object at the
>>> point of initializion.
>>>
>>
>>
>
>



Jan 8 '06 #9

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

Similar topics

22
by: fd123456 | last post by:
Hi Tom ! Sorry about the messy quoting, Google is playing tricks on me at the moment. > Global.asax is where you normally have the Global Application > and Session variables and code to...
5
by: Brian Henry | last post by:
I want to be able to forward any request from my one site to another site based on the IP address... kind of like denying access to the site if an IP is a certain one if they try to access any page...
2
by: Janusz Jezowicz | last post by:
Hello! I would like to have one page on the server, which would be a target processing page for a number of other aspx pages. E.g Processing page \portal_page.aspx Target pages
5
by: ad | last post by:
The Global.asax is code-inside with default. How to change Global.asax to code-behind?
11
by: Ron | last post by:
I have a web project compiled with the new "Web Deployment Projects" plugin for VS2005. I'm deploying the web project to one assembly and with updateable option set to ON. When I'm running the...
16
by: thefritz_j | last post by:
We just converted our VS2003 1.1 VB web project (which was working fine) to VS2005 2.0 and now I get: Parser Error Message: Could not load type '<Namespace>.'. Source Error: Line 1: <%@...
8
by: Rob T | last post by:
When I was using VS2003, I was able to compile my asp.net project locally on my machine and copy it to the production server and it would run just fine. I've now converted to VS2005. The project...
1
by: jbitz | last post by:
Hi, This has got me really baffled. This has got me really baffled. When I run Dim url As String = HttpContext.Current.Request.Url.AbsolutePath.ToLower from Application_beginRequest in...
15
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Just starting to move to ASP.NET 2.0 and having trouble with the Global.asax code file. In 1.1 I could have a code behind file for the global.asax file. This allow for shared variables of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.