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

What is FIRST event on Page to Calculate Session Variables?

I have a small application that consists of one aspx page with inline and
dynamically loaded user and custom controls. When the page loads, I need to
calculate a set of global SESSION variables that will be used by the loaded
controls.

The problem I am having in finding a place where the session variables will
be calculated before any of the page controls or dynamically loaded controls
try to access them.

If I try to calculate the session variables in the page_load event, some of
the user controls that are on the page itself try to use these variables
before the page_load event fires. Same thing with page_init.

Two contraints I have is the need use Page.IsPostBack and
Request.QueryString

I thought maybe the application_request of the global.asax would work but
the QueryString parameters are not available yet.

So here is the question.

Can I set session variables somewhere where I can guarantee they are the
first thing that is calculated and can still access the Page.IsPostBack and
Request.QueryString members?

Thanks for your help

Earl
Nov 18 '05 #1
3 1486
Hi,

I cant see how user control event take place before the page OnInut. but
anyway CreateControlCollection called befor page onInit and querystring
available.

override protected System.Web.UI.ControlCollection
CreateControlCollection ()
{
object o = HttpContext.Current.Request.QueryString;
return base.CreateControlCollection();
}
Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2
Natty,

That did it...Thanks!!!

Earl
"Natty Gur" <na***@dao2com.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,

I cant see how user control event take place before the page OnInut. but
anyway CreateControlCollection called befor page onInit and querystring
available.

override protected System.Web.UI.ControlCollection
CreateControlCollection ()
{
object o = HttpContext.Current.Request.QueryString;
return base.CreateControlCollection();
}
Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #3
Natty,

You are right, Page_Init does work, my bad...

Earl
"Natty Gur" <na***@dao2com.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,

I cant see how user control event take place before the page OnInut. but
anyway CreateControlCollection called befor page onInit and querystring
available.

override protected System.Web.UI.ControlCollection
CreateControlCollection ()
{
object o = HttpContext.Current.Request.QueryString;
return base.CreateControlCollection();
}
Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #4

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

Similar topics

8
by: Danny | last post by:
Hi Could somone please criticise the following program, it went together far to easily (bearing in mind i am just getting into c++) **note the tabs are not as they appear in my compliler** ...
2
by: What-a-Tool | last post by:
I am using a couple of session variables in my site. From what I can figure out, session information is stored on the users computer in a cookie - If the user has cookies disabled, do session...
0
by: Robert Harty | last post by:
Hello all, I have a strange problem with a HtmlTable control, which is dynamically created based on the results of a query. Each row in the table has a LinkButton added to it. When I create...
2
by: Jason | last post by:
I have an ASP.NET page that needs to use values set in session variables to perform certain functions. I have code in the Page_Load event that makes sure the session has not been restarted: If...
0
by: Alexander Widera | last post by:
hello all, i have a problem ... like I already discussed in the thread "session empty" I have the following problem: I created a completely new web... i added 2 files: sessiontest1.aspx:
11
by: OldProgrammer | last post by:
All the documentation and discussion I have read indicate that the Session_End is not supposed to fire unless you are in "inProc" Session state mode, and then only on Session Timeout or at Session...
0
by: =?Utf-8?B?c3Jpbml2YXM=?= | last post by:
Hi, I'm running an ASP.net application where i'm using session variables. The mode is 'InProc' and timeout is 30 mins <sessionState mode="InProc" timeout="30"/>. The application is working fine...
6
by: Mel | last post by:
I have a website that allows the user to generate a new quote. When they are finished creating the quote, it brings them to the final page (called the Goodbye.aspx page) which just states the...
7
by: Ross Culver | last post by:
I need to ensure that session variables are removed whenever someone leaves my web site. My understanding is that this should be happening automatically with the session mode set to InProc. But...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.