PC Review


Reply
Thread Tools Rate Thread

how to declare session variable in global.asax file

 
 
khawar
Guest
Posts: n/a
 
      10th Jul 2003
please provide code sample, i was having trouble declaring
interger and string variable and can we also initialize
them at the same time
thanks for help

 
Reply With Quote
 
 
 
 
GastonQ
Guest
Posts: n/a
 
      10th Jul 2003
Hi khauar, I provide you with a sample that store and
require variables in a Session object.

To save the variables...

string s = "String Value";
int i = 23; // My lucky number;

Session[ "stringValue" ] = s;
Session[ "intValue" ] = i;
....

To get the values...

string s2 = ( string ) Session[ "stringValue" ];
int i2 = ( int ) Session[ "intValue" ];

Regards
Gaston Quirque
Microsoft MVP

>-----Original Message-----
>please provide code sample, i was having trouble

declaring
>interger and string variable and can we also initialize
>them at the same time
>thanks for help
>
>.
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Global.asax.cs and Session[] Just D Microsoft ASP .NET 3 12th Dec 2007 04:04 PM
Session variable value getting lost from global.asax tharika_c@yahoo.com Microsoft ASP .NET 1 25th Sep 2007 11:48 AM
Global.asax.cs and Session Object =?Utf-8?B?Qw==?= Microsoft ASP .NET 2 9th May 2006 01:51 PM
How to terminate a Session in Global.asax? Denon Microsoft ASP .NET 0 14th Nov 2003 10:06 AM
How to terminate a Session in Global.asax? Denon Microsoft ASP .NET 0 14th Nov 2003 09:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:34 PM.