473,790 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to stop processing request in global.asax

GS
What would be the sample code to stop processing any further requests in
Application_onS tart 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 9320
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******** ******@TK2MSFTN GP12.phx.gbl...
What would be the sample code to stop processing any further requests in
Application_onS tart 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******** ******@TK2MSFTN GP12.phx.gbl...
What would be the sample code to stop processing any further requests in
Application_onS tart 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_requ est" 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******** ********@TK2MSF TNGP11.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******** ******@TK2MSFTN GP12.phx.gbl...
What would be the sample code to stop processing any further requests in
Application_onS tart 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******** *****@TK2MSFTNG P10.phx.gbl...
So how exactly I do that?
I don't know which page will be access first so in which page
"begin_requ est" 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******** ********@TK2MSF TNGP11.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******** ******@TK2MSFTN GP12.phx.gbl...
What would be the sample code to stop processing any further requests in
Application_onS tart 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******** ********@TK2MSF TNGP09.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******** *****@TK2MSFTNG P10.phx.gbl...
So how exactly I do that?
I don't know which page will be access first so in which page
"begin_requ est" 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******** ********@TK2MSF TNGP11.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******** ******@TK2MSFTN GP12.phx.gbl...
What would be the sample code to stop processing any further requests
in Application_onS tart 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******** ********@tk2msf tngp13.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******** ********@TK2MSF TNGP09.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******** *****@TK2MSFTNG P10.phx.gbl...
So how exactly I do that?
I don't know which page will be access first so in which page
"begin_requ est" 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******** ********@TK2MSF TNGP11.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******** ******@TK2MSFTN GP12.phx.gbl...
> What would be the sample code to stop processing any further requests
> in Application_onS tart 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_onS tart 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******** ******@TK2MSFTN GP11.phx.gbl...
but you found it, right?

Karl

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

"GS" <no@no.com> wrote in message
news:%2******** ********@tk2msf tngp13.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******** ********@TK2MSF TNGP09.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******** *****@TK2MSFTNG P10.phx.gbl...
So how exactly I do that?
I don't know which page will be access first so in which page
"begin_requ est" 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******** ********@TK2MSF TNGP11.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******** ******@TK2MSFTN GP12.phx.gbl...
>> What would be the sample code to stop processing any further requests
>> in Application_onS tart 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******** **********@TK2M SFTNGP10.phx.gb l...
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_onS tart 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******** ******@TK2MSFTN GP11.phx.gbl...
but you found it, right?

Karl

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

"GS" <no@no.com> wrote in message
news:%2******** ********@tk2msf tngp13.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******** ********@TK2MSF TNGP09.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******** *****@TK2MSFTNG P10.phx.gbl...
> So how exactly I do that?
> I don't know which page will be access first so in which page
> "begin_requ est" 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******** ********@TK2MSF TNGP11.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******** ******@TK2MSFTN GP12.phx.gbl...
>>> What would be the sample code to stop processing any further
>>> requests in Application_onS tart 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
3803
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 manipulate them. It starts > and ends with <script></script> tags. > > Yours looks like a compiled version of it.
5
1606
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 on it and forward it to like google.com or something, how would you go about doing this? and can you do it for ranges also? thanks!
2
2179
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
15154
by: ad | last post by:
The Global.asax is code-inside with default. How to change Global.asax to code-behind?
11
8379
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 generated code on a W2K3 server the application_start and any other event on the global.asax file won't fire. I added tracing and logging to make sure and I can see the code is just not execution. When running the same exact (deployed etc.) code on...
16
5047
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: <%@ Application Codebehind="Global.asax.vb" Inherits="<Namespace>." %> I've done a lot of things I've found on the web to no avial, but here are some unique things about what is happening to me.
8
13208
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 compiles & runs fine locally, but when I copy to the production machine, I get this error: Parser Error Message: Could not load type 'Global'. Source Error: Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="Global" %> Source...
1
5173
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 Global.asax with server that ships with Visual Web Developer everything works as expected. However, today when I tried to move all code onto IIS server this just doesn't return the same URL! On localhost (Visual Web Developer), variable url is...
15
2576
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 Global class. Note: I use these shared variables for read only values that are set at application start. It would appear the 2.0 doesn't like you to use shared variables in the global class. How do I convert my 1.1 applications to 2.0 without...
0
10413
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10145
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9986
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7530
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3707
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.