How to stop processing request in global.asax

  • Thread starter Thread starter GS
  • Start date Start date
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.
 
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
 
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]...
 
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]...
 
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]...
 
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]...
 
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

Back
Top