How to stop processing request in global.asax

G

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.
 
K

Karl Seguin [MVP]

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
 
G

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:%[email protected]...
 
K

Karl Seguin [MVP]

Begin Request is an event of the Global.asax

Karl

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



GS said:
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:%[email protected]...
 
G

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:%[email protected]...
 
G

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:[email protected]...
 
K

Karl Seguin [MVP]

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
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top