Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > using global.asax.vb for defining global parameters

Reply
Thread Tools

using global.asax.vb for defining global parameters

 
 
OK
Guest
Posts: n/a
 
      11-25-2007
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?




 
Reply With Quote
 
 
 
 
Peter Bromberg [C# MVP]
Guest
Posts: n/a
 
      11-25-2007
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?
>
>
>
>
>

 
Reply With Quote
 
 
 
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      11-25-2007
"OK" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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

 
Reply With Quote
 
OK
Guest
Posts: n/a
 
      11-25-2007
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]" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> "OK" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>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



 
Reply With Quote
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      11-25-2007
"OK" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> "Mark Rae [MVP]" <(E-Mail Removed)> schreef in bericht
> news:(E-Mail Removed)...
>> "OK" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>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

 
Reply With Quote
 
Peter Bromberg [C# MVP]
Guest
Posts: n/a
 
      11-26-2007
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]" <(E-Mail Removed)> schreef in bericht
> news:(E-Mail Removed)...
> > "OK" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >>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

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Defining a list of macro parameters. Peter Nilsson C Programming 3 05-01-2008 10:26 PM
Help in defining serial port parameters for data transfer chapeau_melon C++ 5 02-28-2007 04:10 PM
FWSM/PIX and Dynamic PAT using global IP range vs. global interface vs. global IP Hoffa Cisco 1 10-25-2006 06:50 PM
FWSM/PIX and Dynamic PAT using global IP range vs. global interface vs. global IP Hoffa Cisco 0 10-25-2006 01:04 PM
defining or not defining destructors johny smith C++ 8 07-02-2004 08:51 AM



Advertisments