Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in .NET only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
.NET
How To Create a Session Variable
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
sanamashokreddy
New Member
Join Date:
Apr 2008
Posts:
8
#1
How To Create a Session Variable
Apr 16 '08, 04:32 AM
Exaplain me with an example
that will be a great help for me
Thanks in Advance
Mr Gray
New Member
Join Date:
Apr 2008
Posts:
47
#2
Apr 16 '08, 08:01 AM
Hello,
You can create a session variable like so:
Code:
Session["Name"] = value;
Thanks.
Comment
Post
Cancel
sanamashokreddy
New Member
Join Date:
Apr 2008
Posts:
8
#3
Apr 16 '08, 09:26 AM
Originally posted by
Mr Gray
Hello,
You can create a session variable like so:
Code:
Session["Name"] = value;
Thanks.
how to request that.even it is simple please explain me?
Comment
Post
Cancel
Shashi Sadasivan
Recognized Expert
Top Contributor
Join Date:
Aug 2007
Posts:
1435
#4
Apr 16 '08, 09:31 AM
If the session variable does not exist, it will be created.
If it exists, then it will be overwritten !
Code:
object o = Session["Name"]; string name = (string)o;
Is that what you mean by requesting?
Comment
Post
Cancel
kunal pawar
Contributor
Join Date:
Oct 2007
Posts:
297
#5
Apr 16 '08, 09:46 AM
Hi
in VB.net
to Set Session variable
Session.content s("Variable name")= value/ variable
To Get Session Variable
variable name = Session.content s("Variable name")
In C#
To Set Session variable
Session.content s["Variable name"]= value/ variable;
To Get Session Variable
variable name = Session.content s["Variable name"];
Comment
Post
Cancel
malav123
New Member
Join Date:
Feb 2008
Posts:
217
#6
Apr 16 '08, 11:18 AM
Hi,
You can create session variable simply as,
Session("variab lename")= value
and in the project you can use it in any page like,
obj.id=Session( "variablename") ...
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment