ThanksEach session has a session ID. Use Session.SessionID to get it. This id is, however, not unique all the time.
Saturday, March 31, 2012
session uniqueid
Thursday, March 29, 2012
Session Variable
Could someone tell me how to check if a session variable exists and if
not to create it.
Thanks,
MiguelSession["abc"] will return null if abc doesn't exist.
Session["abc"] = 123 will write abc to the session even if it didn't exist
there before.
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"shapper" <mdmoura@.gmail.com> wrote in message
news:1173354277.199378.128980@.j27g2000cwj.googlegroups.com...
> Hello,
> Could someone tell me how to check if a session variable exists and if
> not to create it.
> Thanks,
> Miguel
>
if (Session["MyVar"] == null)
Session["MyVar"] = "hello";
"shapper" <mdmoura@.gmail.com> wrote in message
news:1173354277.199378.128980@.j27g2000cwj.googlegroups.com...
> Hello,
> Could someone tell me how to check if a session variable exists and if
> not to create it.
> Thanks,
> Miguel
>
Session Variable
I have a simple problem...when I create a session variable as such:
Session("ID") = 1
and read this varaible from time to time...
The problem is that it is shared by all users not just the user that
created the session variable...
That is, if another user logs on and sets
Session("ID") = 2
then this will change the value if Session("ID") for the first
user...
What I want is to have different ID's for each user...
Can someone elxplain what is wrong?
Thanks...It shouldn't happen and I've never seent that. Are you sure this is
System.Web.HttpContext.Current.Session and not some other cusom session
object. You can also dump the SessionID to see if this is the same value (is
this hardcoded somewhere ?). What if you do a bare bone sample that shoes
that in your dev server on a bare bone site. Do you have the same problem ?
Ah ! Do you open another window and test to check this ? Note that when you
open another window (without relancunhing i..e) the new window uses the same
session.
--
Patrice
"Flurry" <cj406168@.stmail.staffs.ac.uka crit dans le message de news:
1189422564.511977.244720@.d55g2000hsg.googlegroups. com...
Quote:
Originally Posted by
Hello...
>
I have a simple problem...when I create a session variable as such:
>
Session("ID") = 1
>
and read this varaible from time to time...
>
The problem is that it is shared by all users not just the user that
created the session variable...
>
That is, if another user logs on and sets
>
Session("ID") = 2
>
then this will change the value if Session("ID") for the first
user...
>
What I want is to have different ID's for each user...
>
Can someone elxplain what is wrong?
>
Thanks...
>
You must be doing something else in your code that you haven't shown, or you
are using another Browser window from the same session, because this is
definitely *not* the expected behavior.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
"Flurry" wrote:
Quote:
Originally Posted by
Hello...
>
I have a simple problem...when I create a session variable as such:
>
Session("ID") = 1
>
and read this varaible from time to time...
>
The problem is that it is shared by all users not just the user that
created the session variable...
>
That is, if another user logs on and sets
>
Session("ID") = 2
>
then this will change the value if Session("ID") for the first
user...
>
What I want is to have different ID's for each user...
>
Can someone elxplain what is wrong?
>
Thanks...
>
>
Hello and thank you both for your reply...
This is strange...the code is very simple...I have two aspx pages:-
Page 1 has the following code
System.Web.HttpContext.Current.Session ("Country" ) = countryCode
server.transfer("FOTrans.aspx")
FOTrans.aspx just reads the country code as follows...
countryCode = System.Web.HttpContext.Current.Session("country")
However, as I said before the session variable is shared between
users. I have just tried logging on using two different PC's and the
problem exists. If I set Session("Country") to USA on the first pc
then set it to UK in the second pc, the first pc reads UK not USA...
Any ideas as to what could be wrong?
Thanks...
re:
!System.Web.HttpContext.Current.Session ("Country" ) = countryCode
Where dos the value for countryCode come from ?
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Flurry" <cj406168@.stmail.staffs.ac.ukwrote in message news:1189430823.328225.66540@.57g2000hsv.googlegrou ps.com...
Quote:
Originally Posted by
Hello and thank you both for your reply...
>
This is strange...the code is very simple...I have two aspx pages:-
>
Page 1 has the following code
>
System.Web.HttpContext.Current.Session ("Country" ) = countryCode
server.transfer("FOTrans.aspx")
>
FOTrans.aspx just reads the country code as follows...
>
countryCode = System.Web.HttpContext.Current.Session("country")
>
However, as I said before the session variable is shared between
users. I have just tried logging on using two different PC's and the
problem exists. If I set Session("Country") to USA on the first pc
then set it to UK in the second pc, the first pc reads UK not USA...
>
Any ideas as to what could be wrong?
>
Thanks...
>
>
>
Thanks for your replies...however, I've discovered my mistake...I'm
using a shared variable to hold the Session("Country") e.g.
Shared countryCode as String.
CountryCode = Session("Country")
I was using the shred variable as a global variable...I just didn't
realise that shared variables have scope outside their own session.
This is right isn't it?
Thanks for your help...
"Flurry" <cj406168@.stmail.staffs.ac.ukwrote in message
news:1189433300.687467.258850@.50g2000hsm.googlegro ups.com...
Quote:
Originally Posted by
Thanks for your replies...however, I've discovered my mistake...I'm
using a shared variable to hold the Session("Country") e.g.
>
Shared countryCode as String.
CountryCode = Session("Country")
>
I was using the shared variable as a global variable...I just didn't
realise that shared variables have scope outside their own session.
This is right isn't it?
Yes it is. Shared variables in ASP.NET need *extremely* careful
management...
Avoid them if you can...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
re:
!shared variables have scope outside their own session.
!This is right isn't it?
Exactly, and that is why I asked where that value came from.
I suspected you were setting a global variable.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Flurry" <cj406168@.stmail.staffs.ac.ukwrote in message news:1189433300.687467.258850@.50g2000hsm.googlegro ups.com...
Quote:
Originally Posted by
Thanks for your replies...however, I've discovered my mistake...I'm
using a shared variable to hold the Session("Country") e.g.
>
Shared countryCode as String.
CountryCode = Session("Country")
>
I was using the shred variable as a global variable...I just didn't
realise that shared variables have scope outside their own session.
This is right isn't it?
>
Thanks for your help...
>
>
Session Variable
Could someone tell me how to check if a session variable exists and if
not to create it.
Thanks,
MiguelSession["abc"] will return null if abc doesn't exist.
Session["abc"] = 123 will write abc to the session even if it didn't exist
there before.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"shapper" <mdmoura@.gmail.comwrote in message
news:1173354277.199378.128980@.j27g2000cwj.googlegr oups.com...
Quote:
Originally Posted by
Hello,
>
Could someone tell me how to check if a session variable exists and if
not to create it.
>
Thanks,
Miguel
>
if (Session["MyVar"] == null)
Session["MyVar"] = "hello";
"shapper" <mdmoura@.gmail.comwrote in message
news:1173354277.199378.128980@.j27g2000cwj.googlegr oups.com...
Quote:
Originally Posted by
Hello,
>
Could someone tell me how to check if a session variable exists and if
not to create it.
>
Thanks,
Miguel
>
Monday, March 26, 2012
Session Variable Disappeared
I'm using MasterPages to create the layout for all of the pages in my project. Before I converted the Default.aspx page over to the masterpage format this worked.
I have two pages, login.aspx and default.aspx, of course I'm using Forms Authentication. All that works fine, you try to get to default it prompts for login.
Well I used a custom function for the login, it compares data entered to that in a database, if it passed it also returns a variable containing there Trust Level. (String)
At the end of the Button Submit Click but before I redirect the authenticated user to the page they requested I use this code to store trust level in the Session object.
Session("Trust")=TRUST
When the default page loads it shows/hides elements base on thier trust. Now after I've switched over to master pages the code no longer works, it's returning an empty string for Session("Trust")
Example:
<% If Session("Trust") = "Admin" Then %>
Your Access Level is Administrator
<% Else %>
Your Access Level is <% Response.Write(Session("Trust")) %>
<% End If %
I'm loggin in with the Admin Account with a trust of "Admin" and it's just returning an empty string.
Any ideas?What are you using to redirect? If you are not currently, you should be using the RedirectFromLoginPage method.
HTH...
CHris
Thx for the reply,
I figured it out, it was because I deleted the Global.* file. D'OH
Session Variable in Class
I am trying to create a seesion variable in a class. When I try to compile it I get the following error.
CS0103: The name 'Session'does not exist in the class or namespace 'DatabaseConnection.DbConnect'
In the class file I try to create the session variable as follows
Session["CompanyName"]="Name";
Anyone have any ideas of my problem?HttpContext.Current.Session
When you use "Session" in a WebForm, you are accessing a property (Page.Session), which returns an HttpSessionState object, which you then index using ["CompanyName"]. If your class is not derived from Page (or several other classes which have a Session property), then your class doesn't have a Session property for you to use. Fortunately you can use the static method HttpContext.Current to get the current HttpContext object, which then gives you access to session state through its Session property.
AutoFed
Thanks for this.
How do I convert a session object to a boolean type or an integer?
You can use, Convert.ToInt32 and Convert.ToBoolean methods. These are the static methods of "Convert" class, which take object type as the parameter. So, you can pass your session variable to these methods to convert to the required type
It depends on what object you assigned to the session variable. If you assigned an integer to the session variable, e.g. Session["MyInt"] = 16, then you just need to cast it back to an int when you read it out, int myInt = (int)Session["myInt"]. If you assigned a string to the sesson variable, e.g. Session["MyInt"] = "16", and you want to convert that to an int, you can use Int32.Parse. You should only use the Convert functions if you don't know what the type of the object is, since there is some extra overhead in determining what the type is before converting it.
AutoFed
Session variable is lost between ASP & ASP.NET pages
I must be missing something here. I have an ASP page that I create a
Session variable in as follows.
Session ("name")="Joe"
In an ASP.NET page in the same project and the same session, I call the
Session variable as follows:
Dim str As String
str = Session("name")
When I do a Response.Write (str), nothing writes to the screen.
Any thoughts on what is happening here would be appreciatedUhhhh...
Yeah , that is what it will do. It doesn't work like that.
You can check this out
http://www.asp101.com/articles/sidn...ate/default.asp
but ... the thing surprising you, isn't surprising at all. They are
different technologies...
with nothing but the phrase "asp" in common.
"glenn" <glenn@.discussions.microsoft.com> wrote in message
news:16EE097D-5F1E-4742-AB89-E05057E59EA0@.microsoft.com...
> Hi folks,
> I must be missing something here. I have an ASP page that I create a
> Session variable in as follows.
> Session ("name")="Joe"
> In an ASP.NET page in the same project and the same session, I call the
> Session variable as follows:
> Dim str As String
> str = Session("name")
> When I do a Response.Write (str), nothing writes to the screen.
> Any thoughts on what is happening here would be appreciated
re:
>nothing but the phrase "asp" in common
Absolutely...
The seminal work on sharing session state between ASP and ASP.NET is :
"How to Share Session State Between Classic ASP and ASP.NET"
http://msdn.microsoft.com/library/d...
rttoaspnet.asp
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"sloan" <sloan@.ipass.net> wrote in message news:%23zLsJArUGHA.1160@.TK2MSFTNGP09.phx.gbl...[
color=darkred]
> Uhhhh...
> Yeah , that is what it will do. It doesn't work like that.
> You can check this out
> http://www.asp101.com/articles/sidn...ate/default.asp
> but ... the thing surprising you, isn't surprising at all. They are
> different technologies...with nothing but the phrase "asp" in common.
>
>
> "glenn" <glenn@.discussions.microsoft.com> wrote in message
> news:16EE097D-5F1E-4742-AB89-E05057E59EA0@.microsoft.com...
>[/color]
Session variable is lost between ASP & ASP.NET pages
I must be missing something here. I have an ASP page that I create a
Session variable in as follows.
Session ("name")="Joe"
In an ASP.NET page in the same project and the same session, I call the
Session variable as follows:
Dim str As String
str = Session("name")
When I do a Response.Write (str), nothing writes to the screen.
Any thoughts on what is happening here would be appreciatedUhhhh...
Yeah , that is what it will do. It doesn't work like that.
You can check this out
http://www.asp101.com/articles/sidn...ate/default.asp
but ... the thing surprising you, isn't surprising at all. They are
different technologies...
with nothing but the phrase "asp" in common.
"glenn" <glenn@.discussions.microsoft.com> wrote in message
news:16EE097D-5F1E-4742-AB89-E05057E59EA0@.microsoft.com...
> Hi folks,
> I must be missing something here. I have an ASP page that I create a
> Session variable in as follows.
> Session ("name")="Joe"
> In an ASP.NET page in the same project and the same session, I call the
> Session variable as follows:
> Dim str As String
> str = Session("name")
> When I do a Response.Write (str), nothing writes to the screen.
> Any thoughts on what is happening here would be appreciated
re:
>nothing but the phrase "asp" in common
Absolutely...
The seminal work on sharing session state between ASP and ASP.NET is :
"How to Share Session State Between Classic ASP and ASP.NET"
http://msdn.microsoft.com/library/d...erttoaspnet.asp
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"sloan" <sloan@.ipass.net> wrote in message news:%23zLsJArUGHA.1160@.TK2MSFTNGP09.phx.gbl...
> Uhhhh...
> Yeah , that is what it will do. It doesn't work like that.
> You can check this out
> http://www.asp101.com/articles/sidn...ate/default.asp
> but ... the thing surprising you, isn't surprising at all. They are
> different technologies...with nothing but the phrase "asp" in common.
>
>
> "glenn" <glenn@.discussions.microsoft.com> wrote in message
> news:16EE097D-5F1E-4742-AB89-E05057E59EA0@.microsoft.com...
>> Hi folks,
>>
>> I must be missing something here. I have an ASP page that I create a
>> Session variable in as follows.
>>
>> Session ("name")="Joe"
>>
>> In an ASP.NET page in the same project and the same session, I call the
>> Session variable as follows:
>>
>> Dim str As String
>> str = Session("name")
>>
>> When I do a Response.Write (str), nothing writes to the screen.
>>
>> Any thoughts on what is happening here would be appreciated
Thursday, March 22, 2012
session variables
Hi, I need to create a session variable in a page that is given a set string value.
In the next page I need to call that variable in the WHERE part of a SELECT clause eg.
SELECT [colA], [colB] WHERE colB = 'value from previous page'
Any help would be greatly appreciated.
Cheers, Chris
VB.NET:
"SELECT [colA], [colB] WHERE colB ='" & Session("Name") & "'"
C#
"SELECT [colA], [colB] WHERE colB ='" + Session["Name"] as string + "'"
HTH,
Ryan
Brilliant, cheers. How do I create the variable in the previous page in VB.NET
Cheers again, Chris
TheCrawsh wrote:
How do I create the variable in the previous page in VB.NET
Session("SomeSession") = SomeValue
Since the value is stored as an object, SomeValue can be of any datatype.
HTH,
Ryan
Cheers, I think I have the syntax wrong, I'm not sure on exactly where to put these, I have this so far:
In the page where the variable is created:
<scriptrunat="server">
Session("banner") ="BSAFD"
</script>
But do I need to put it in a function or something?
In the page that uses the variable:
<asp:SqlDataSourceID="BanRot"runat="server"ConnectionString="<%$ ConnectionStrings:w2gConnectionString %>"
SelectCommand="SELECT [Pic], [Nav], [Page], [Alt] FROM [ads-home] WHERE Page ='" &Session("Banner") &"'">
</asp:SqlDataSource>
Do I need to 'call' the variable in a parameter or something?
Many thanks, Chris
You can declare the session variable anywhere in your code. Just be sure to do it before you use it. Also, you can use the SessionParameter with the SqlDataSource in conjunction with the SelectCommand.
<asp:SqlDataSource ID="BanRot" runat="server" ConnectionString="<%$ ConnectionStrings:w2gConnectionString %>" SelectCommand="SELECT [Pic], [Nav], [Page], [Alt] FROM [ads-home] WHERE Page =?">
<SelectParameters>
<asp:SessionParameter Name="Page"SessionField="Banner" />
</SelectParameters>
</asp:SqlDataSource>
HTH,
Ryan
Ok, do I need to call it in the script on the same page as the sqldatasource? Or does the Session parameter automatically call it from the memory?
Also, On the initial page where I create the variable, I have
<scriptrunat="server">
Session("banner") = BSAFD
</script>
But I'm getting a 'Declaration Expected' Error, Do I need to put this in a function?
Cheers again, Chris
All you need is the SessionParameter for the SelectCommand and .NET will take care of the rest for you.
When you decalre your session variable, unless BSAFD is a variable, you'll need to enclose it in quotes as it is a string.
Session("Banner") = "BSAFD"
HTH,
Ryan
Ah, brilliant, I now have it working, I got confused with the ? in the WHERE clause, I've now changed it to @.Page - is this just a shortcut meaning put your Parameter here.
Another quick question, I have many pages that have a different variable so it will have a different session variable. If I create a new variable in a different page, will it overwrite the old one or do I need to put some code in there to do it, eg.
Page one:
<% Session("banner") ="value a" %>
I then use that however , but then navigate to page two where I want value b as the session variable, if I put in this:
<% Session("banner") ="value 2" %>
Will it overwrite the old one?
Cheers again, perfect help!! Chris
TheCrawsh wrote:
I've now changed it to @.Page - is this just a shortcut meaning put your Parameter here.
Yes. It's a placeholder for the value.
TheCrawsh wrote:
If I create a new variable in a different page, will it overwrite the old one or do I need to put some code in there to do it, eg.
Yes. Doing so would assign a new value to the session variable.
HTH,
Ryan
Session variables
I want to create a shopping application that allows the user to buy as many items as desired before checking out (just like you see in amazon.com). I thought of a global array type variable in which I could write from all over the application. However, I am not sure how to make this work. Could you please show me what you would enter in the global.asax and in one of those buying pages in order for this to work so that I can have an idea to start with it?
Many thanks
Regards
Edited by haidar_bilal :: Place your links within the<a> and</a> tag. Thank you.
shredmaster,
There was an article posted on this site early this week using a datatable in a Session variable:
Shopping Cart DataTables
This may give you some more ideas.
cjmaxey
Session Variables
The proper way to create a session variable is:
Session["VarName"] = value;
Or you can use the Add method as:
Session.Add("VarName", value);
Either way will work.
Next to remove an item from the session state:
Session.Remove("VarName");
To clear all items from the session state use:
Session.Clear();
HTH.
Jeff Ptak
>--Original Message--
>What is the proper way to creating Session Variables and
destroying them. I
>think this is what my major problem is. And, can that be
done also for
>ADO.NET objects?
>Thanks
>Tibby
>
>.Just to make sure I'm playing ball here, so, instead of using Dim myVar as
string, then later using myVar="Kiss Me", I would use Session["myVar"]="Kiss
Me", then to reference it, I would use something like
MsgBox(Session["myVar"])
Just to make sure I'm on the same page.
Thanks
Tibby
"J. Ptak" <ptakja@.NOSPAM.corning.com> wrote in message
news:8eb301c35b69$62ce8060$a001280a@.phx.gbl...
> Hey Tibby.
> The proper way to create a session variable is:
> Session["VarName"] = value;
> Or you can use the Add method as:
> Session.Add("VarName", value);
> Either way will work.
> Next to remove an item from the session state:
> Session.Remove("VarName");
> To clear all items from the session state use:
> Session.Clear();
> HTH.
> Jeff Ptak
>
> >--Original Message--
> >What is the proper way to creating Session Variables and
> destroying them. I
> >think this is what my major problem is. And, can that be
> done also for
> >ADO.NET objects?
> >Thanks
> >Tibby
> >.
I apoligize, I'm using VB.Net.
"Kevin Spencer" <kevin@.takempis.com> wrote in message
news:OaUHXi3WDHA.1620@.TK2MSFTNGP12.phx.gbl...
> Forget about "MsgBox." That function is not for ASP.Net pages. It is only
> used for Windows Forms. Other than that, you are basically corrrect.
> However, it is hard to tell whether you're using VB.Net or C# from your
> example, as the MsgBox function is a VB.Net function, but your syntax for
> the Session variable is C#. Here are 2 examples, using VB.Net and C#:
> VB.Net: Session("myVar") = "Kiss Me"
> C#: Session["myVar"] = "Kiss Me";
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> http://www.takempis.com
> Complex things are made up of
> lots of simple things.
> "Tibby" <tierscheiss1977@.hotmail.com> wrote in message
> news:uM5PwY3WDHA.2568@.tk2msftngp13.phx.gbl...
> > Just to make sure I'm playing ball here, so, instead of using Dim myVar
as
> > string, then later using myVar="Kiss Me", I would use
> Session["myVar"]="Kiss
> > Me", then to reference it, I would use something like
> > MsgBox(Session["myVar"])
> > Just to make sure I'm on the same page.
> > Thanks
> > Tibby
> > "J. Ptak" <ptakja@.NOSPAM.corning.com> wrote in message
> > news:8eb301c35b69$62ce8060$a001280a@.phx.gbl...
> > > Hey Tibby.
> > > > The proper way to create a session variable is:
> > > > Session["VarName"] = value;
> > > > Or you can use the Add method as:
> > > > Session.Add("VarName", value);
> > > > Either way will work.
> > > > Next to remove an item from the session state:
> > > > Session.Remove("VarName");
> > > > To clear all items from the session state use:
> > > > Session.Clear();
> > > > HTH.
> > > > Jeff Ptak
> > > > > >--Original Message--
> > > >What is the proper way to creating Session Variables and
> > > destroying them. I
> > > >think this is what my major problem is. And, can that be
> > > done also for
> > > >ADO.NET objects?
> > > > > >Thanks
> > > >Tibby
> > > > > > > >.
> >
No apology neccessary! That's what we're here for. :)
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.
"Tibby" <tierscheiss1977@.hotmail.com> wrote in message
news:OKRSgL4WDHA.2268@.TK2MSFTNGP11.phx.gbl...
> I apoligize, I'm using VB.Net.
> "Kevin Spencer" <kevin@.takempis.com> wrote in message
> news:OaUHXi3WDHA.1620@.TK2MSFTNGP12.phx.gbl...
> > Forget about "MsgBox." That function is not for ASP.Net pages. It is
only
> > used for Windows Forms. Other than that, you are basically corrrect.
> > However, it is hard to tell whether you're using VB.Net or C# from your
> > example, as the MsgBox function is a VB.Net function, but your syntax
for
> > the Session variable is C#. Here are 2 examples, using VB.Net and C#:
> > VB.Net: Session("myVar") = "Kiss Me"
> > C#: Session["myVar"] = "Kiss Me";
> > --
> > HTH,
> > Kevin Spencer
> > Microsoft MVP
> > .Net Developer
> > http://www.takempis.com
> > Complex things are made up of
> > lots of simple things.
> > "Tibby" <tierscheiss1977@.hotmail.com> wrote in message
> > news:uM5PwY3WDHA.2568@.tk2msftngp13.phx.gbl...
> > > Just to make sure I'm playing ball here, so, instead of using Dim
myVar
> as
> > > string, then later using myVar="Kiss Me", I would use
> > Session["myVar"]="Kiss
> > > Me", then to reference it, I would use something like
> > > MsgBox(Session["myVar"])
> > > Just to make sure I'm on the same page.
> > > > Thanks
> > > Tibby
> > > > "J. Ptak" <ptakja@.NOSPAM.corning.com> wrote in message
> > > news:8eb301c35b69$62ce8060$a001280a@.phx.gbl...
> > > > Hey Tibby.
> > > > > > The proper way to create a session variable is:
> > > > > > Session["VarName"] = value;
> > > > > > Or you can use the Add method as:
> > > > > > Session.Add("VarName", value);
> > > > > > Either way will work.
> > > > > > Next to remove an item from the session state:
> > > > > > Session.Remove("VarName");
> > > > > > To clear all items from the session state use:
> > > > > > Session.Clear();
> > > > > > HTH.
> > > > > > Jeff Ptak
> > > > > > > > >--Original Message--
> > > > >What is the proper way to creating Session Variables and
> > > > destroying them. I
> > > > >think this is what my major problem is. And, can that be
> > > > done also for
> > > > >ADO.NET objects?
> > > > > > > >Thanks
> > > > >Tibby
> > > > > > > > > > >.
> > > > >