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

Global.asa, AcquireRequestState and Session

The global.asax page can have an event handler for AcquireRequestState. This
is where a session can be accessed for the first time before the control
ends up in the target page itself.

However if the target page has its EnableSession property set to false, then
the Session property can not be accessed (either in the page or in
Global.asax) as there will be no session. In such case, if Session property
is accessed, the HttpException (with message: Session is not valid in this
context) is thrown.

Is there a programmatic way (that does not include catching exception) of
detecting if currently executing page has the session disabled in the
global.asax?

Thanks.
Raghu/..
Nov 19 '05 #1
1 5468
Landed on the solution right after sending this this message.

Context.Session will be null for the pages that disabled session state.

Thanks.
Raghu/..

"Raghu" <Ra***@Nospam.com> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
The global.asax page can have an event handler for AcquireRequestState. This is where a session can be accessed for the first time before the control
ends up in the target page itself.

However if the target page has its EnableSession property set to false, then the Session property can not be accessed (either in the page or in
Global.asax) as there will be no session. In such case, if Session property is accessed, the HttpException (with message: Session is not valid in this
context) is thrown.

Is there a programmatic way (that does not include catching exception) of
detecting if currently executing page has the session disabled in the
global.asax?

Thanks.
Raghu/..

Nov 19 '05 #2

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

Similar topics

0
by: Submit | last post by:
Hi, I'm using Global.asa on my web site, our Web server migrate to a new server from Platform WinNT to Platform (Nt+ Unix) do te server will not support Global.asa My question is: in the...
7
by: Matt Calhoon | last post by:
Hi there, How does IIS 6.0 treat the global.asa file? I had the following problem; 1. uploaded a new site to the win3k server 2. had incorrect db connection string in Session_OnStart in...
4
by: abcd | last post by:
I have an asp page in which first line is <@ ENABLESESSIONONSTATE = false %> I want to stop the sessions for this page. I have global.asa page whose code is like this <SCRIPT RUNAT=Server...
10
by: David P. Donahue | last post by:
When I wrote websites in VB .NET, I would often put functions in Global for all the pages to call. Now, in C#, doing so results in "references to non-static objects" and whatnot. I realize what...
8
by: Thomas Coleman | last post by:
Ok, I've obviously discovered that Global.aspx has been completely changed in ..NET 2.0. However, I haven't figured out how to declare a constant that's available to any page in my application...
0
by: Mark | last post by:
I am testing the tracing function of ASP.NET 2.0 and have included the following code in the the global.asax file: protected void Application_AcquireRequestState(object sender, EventArgs e) { ...
5
by: Sandman | last post by:
I dont think I understand them. I've read the section on scope in the manual inside out. I'm running PHP 5.2.0 Here is the code I'm working on: //include_me.php <?php $MYVAR = array(); global...
11
by: Sylvia A. | last post by:
How can I define global classes in web application ? Classes can be set to session variables ? Thanks
2
by: arun1985 | last post by:
In the project i am using i am having the following code and when i upload it to the server.Its givig me the following error in the global.cs file. Server Error in '/' Application. ...
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
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...
0
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...

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.