Add a GUID value to the Session variable

I am trying to take the value of a GUID function and add it to a session variable.  How can I do that?
VBBRettAsked:
Who is Participating?
 
Jitendra PatilSr.Software EngineerCommented:
Hi VBRett,
try the below code.

string  g = Guid.NewGuid().ToString() ;
           Session["MyGuid"] = g;
           Response.Write("Guid Generated=>" + Session["MyGuid"].ToString());

hope this helps.
0
 
VBBRettAuthor Commented:
That's the thing.  I'm pulling the GUID from a record in the database.  I'll post the code that I have when I get home.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.