|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to stop processing request in global.asaxWhat 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 Show quote "GS" <n*@no.com> wrote in message news:unLTGQ8EGHA.2380@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. > 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 Show quote net> wrote in message news:%23xUZdS8EGHA.2648@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" <n*@no.com> wrote in message > news:unLTGQ8EGHA.2380@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. >> > > Begin Request is an event of the Global.asax
Karl Show quote "GS" <n*@no.com> wrote in message news:uh$ira8EGHA.868@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:%23xUZdS8EGHA.2648@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" <n*@no.com> wrote in message >> news:unLTGQ8EGHA.2380@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. >>> >> >> > > 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 Show quote net> wrote in message news:%23MT4$l8EGHA.3920@TK2MSFTNGP09.phx.gbl... > Begin Request is an event of the Global.asax > > Karl > > -- > http://www.openmymind.net/ > > > > "GS" <n*@no.com> wrote in message > news:uh$ira8EGHA.868@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:%23xUZdS8EGHA.2648@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" <n*@no.com> wrote in message >>> news:unLTGQ8EGHA.2380@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. >>>> >>> >>> >> >> > > but you found it, right?
Karl Show quote "GS" <n*@no.com> wrote in message news:%23wnJsn8EGHA.2912@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:%23MT4$l8EGHA.3920@TK2MSFTNGP09.phx.gbl... >> Begin Request is an event of the Global.asax >> >> Karl >> >> -- >> http://www.openmymind.net/ >> >> >> >> "GS" <n*@no.com> wrote in message >> news:uh$ira8EGHA.868@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:%23xUZdS8EGHA.2648@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" <n*@no.com> wrote in message >>>> news:unLTGQ8EGHA.2380@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. >>>>> >>>> >>>> >>> >>> >> >> > > 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 Show quote net> wrote in message news:ey0$hT9EGHA.1028@TK2MSFTNGP11.phx.gbl... > but you found it, right? > > Karl > > -- > http://www.openmymind.net/ > > > > "GS" <n*@no.com> wrote in message > news:%23wnJsn8EGHA.2912@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:%23MT4$l8EGHA.3920@TK2MSFTNGP09.phx.gbl... >>> Begin Request is an event of the Global.asax >>> >>> Karl >>> >>> -- >>> http://www.openmymind.net/ >>> >>> >>> >>> "GS" <n*@no.com> wrote in message >>> news:uh$ira8EGHA.868@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:%23xUZdS8EGHA.2648@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" <n*@no.com> wrote in message >>>>> news:unLTGQ8EGHA.2380@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. >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > 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 Show quote "GS" <n*@no.com> wrote in message news:%23pV95f%23EGHA.3064@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:ey0$hT9EGHA.1028@TK2MSFTNGP11.phx.gbl... >> but you found it, right? >> >> Karl >> >> -- >> http://www.openmymind.net/ >> >> >> >> "GS" <n*@no.com> wrote in message >> news:%23wnJsn8EGHA.2912@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:%23MT4$l8EGHA.3920@TK2MSFTNGP09.phx.gbl... >>>> Begin Request is an event of the Global.asax >>>> >>>> Karl >>>> >>>> -- >>>> http://www.openmymind.net/ >>>> >>>> >>>> >>>> "GS" <n*@no.com> wrote in message >>>> news:uh$ira8EGHA.868@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:%23xUZdS8EGHA.2648@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" <n*@no.com> wrote in message >>>>>> news:unLTGQ8EGHA.2380@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. >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > in 2.0 you can also use an App_Offline.htm file, take a look at:
http://weblogs.asp.net/eporter/archive/2005/10/05/426708.aspx Karl Show quote "GS" <n*@no.com> wrote in message news:unLTGQ8EGHA.2380@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. > |
|||||||||||||||||||||||