473,398 Members | 2,380 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,398 software developers and data experts.

using global.asax.vb for defining global parameters

OK
I use Global.asx.vb for declaration of my global paramaters such as the
Employee number of an Employee who logged into the website. I found this as
the only way to handle these parameters in another aspx pages. Anyting works
good up to now.

In case another employee logs into the website who of course has another
employee number while the first employee still is online, does asp.net for
vb handle this as a session parameter or will the global parameter be
overwritten?


Nov 25 '07 #1
5 2089
You really want to store this kind of user-specific stuff in Session state.
Global static("shared") variables are "only ever one copy" - they get
overwritten if you change them.

--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com

"OK" wrote:
I use Global.asx.vb for declaration of my global paramaters such as the
Employee number of an Employee who logged into the website. I found this as
the only way to handle these parameters in another aspx pages. Anyting works
good up to now.

In case another employee logs into the website who of course has another
employee number while the first employee still is online, does asp.net for
vb handle this as a session parameter or will the global parameter be
overwritten?


Nov 25 '07 #2
"OK" <ok*@xs4all.nlwrote in message
news:eE**************@TK2MSFTNGP02.phx.gbl...
>I use Global.asx.vb for declaration of my global paramaters such as the
Employee number of an Employee who logged into the website. I found this as
the only way to handle these parameters in another aspx pages. Anyting
works good up to now.

In case another employee logs into the website who of course has another
employee number while the first employee still is online, does asp.net for
vb handle this as a session parameter or will the global parameter be
overwritten?

For user-specific metadata which you want to cache, create it in
Session_Start and store it in the Session object...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Nov 25 '07 #3
OK
Thanks Mark and Peter,

Is there a way of defining the session variables in vb at forehand in such
that I can refer to them as a property such as Sessionparameters.ID_employee
rather than typing (Session("ID_employee") them?

Oscar
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netschreef in bericht
news:OH**************@TK2MSFTNGP03.phx.gbl...
"OK" <ok*@xs4all.nlwrote in message
news:eE**************@TK2MSFTNGP02.phx.gbl...
>>I use Global.asx.vb for declaration of my global paramaters such as the
Employee number of an Employee who logged into the website. I found this
as the only way to handle these parameters in another aspx pages. Anyting
works good up to now.

In case another employee logs into the website who of course has another
employee number while the first employee still is online, does asp.net
for vb handle this as a session parameter or will the global parameter be
overwritten?


For user-specific metadata which you want to cache, create it in
Session_Start and store it in the Session object...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Nov 25 '07 #4
"OK" <ok*@xs4all.nlwrote in message
news:Ot**************@TK2MSFTNGP03.phx.gbl...
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netschreef in bericht
news:OH**************@TK2MSFTNGP03.phx.gbl...
>"OK" <ok*@xs4all.nlwrote in message
news:eE**************@TK2MSFTNGP02.phx.gbl...
>>>I use Global.asx.vb for declaration of my global paramaters such as the
Employee number of an Employee who logged into the website. I found this
as the only way to handle these parameters in another aspx pages. Anyting
works good up to now.

In case another employee logs into the website who of course has another
employee number while the first employee still is online, does asp.net
for vb handle this as a session parameter or will the global parameter
be overwritten?

For user-specific metadata which you want to cache, create it in
Session_Start and store it in the Session object...

Is there a way of defining the session variables in vb at forehand in such
that I can refer to them as a property such as
Sessionparameters.ID_employee rather than typing (Session("ID_employee")
them?
Not natively. You could write a Session wrapper, I suppose, but I can't see
the point...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Nov 25 '07 #5
Dood. Don't get hung up on the small stuff when you are just getting on first
base.
Later, you may be able to afford persnicketiness.
--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com

"OK" wrote:
Thanks Mark and Peter,

Is there a way of defining the session variables in vb at forehand in such
that I can refer to them as a property such as Sessionparameters.ID_employee
rather than typing (Session("ID_employee") them?

Oscar
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netschreef in bericht
news:OH**************@TK2MSFTNGP03.phx.gbl...
"OK" <ok*@xs4all.nlwrote in message
news:eE**************@TK2MSFTNGP02.phx.gbl...
>I use Global.asx.vb for declaration of my global paramaters such as the
Employee number of an Employee who logged into the website. I found this
as the only way to handle these parameters in another aspx pages. Anyting
works good up to now.

In case another employee logs into the website who of course has another
employee number while the first employee still is online, does asp.net
for vb handle this as a session parameter or will the global parameter be
overwritten?

For user-specific metadata which you want to cache, create it in
Session_Start and store it in the Session object...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


Nov 26 '07 #6

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

Similar topics

1
by: Tina | last post by:
I would like to know the preferred way in which to define, store, and retrieve global varialbes in asp.net applications. I have read through past threads here and have seen mixed advice. Some say...
12
by: Luther Hert | last post by:
While trying to work through textbook lessons for Vb.net Step by Step,Version 2003, Chapter 22, the first step is to create a new Web application Project,using the ASP.Net Application icon in the...
5
by: vbMental | last post by:
I am deep into a project and cannot get this to work correctly. I am trying to make a custom error page that will be able to know what exception occurred. I already know about the defaultRedirect...
12
by: John M | last post by:
Hello, On Microsoft Visual Studio .NET 2003, I want to use some global elements, that can be used in each one of my pages. i.e I put a oleDBConnection on global.asax.vb How can I use it...
3
by: gordonfmoore | last post by:
Hi, for some reason? I learnt it was sensible/useful to put any parameters that I wanted users to be able to change in the global.asax file. So my code would look like: //in my page load...
8
by: Bill | last post by:
Anyone have any success in using global.asax to protect images in a folder from being linked to by external websites? I'd tried to use global.asa in the past, with no success. Any help would be...
2
by: tshad | last post by:
I have my error handling set up in Global.asax: Sub Application_Error(Sender As Object, E as EventArgs) In this procedure I call a function in a dll that will write out to a history file. ...
1
by: Anonieko | last post by:
Global.asax? Use HttpModules Instead! In a previous post, I talked about HttpHandlers - an underused but incredibly useful feature of ASP.NET. Today I want to talk about HttpModules, which are...
4
by: Al Santino | last post by:
Hello, I've created a simple C# web services project using Visual Studio 2005. My service compiles and runs correctly when called by remote clients. I'm able to step through the service in the...
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
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
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
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
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...
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.