nikdonovanau
asked on
Set Cookie in ASP.NET
Hi Experts
I am trying to set a cookie in ASP.NET
What I want to do is store the Id of the logged in user into a cookie.
What I have is
Response.Cookies("LoggedIn User").Exp ires = "5/1/2010"
Response.Cookies("LoggedIn User").Val ue = Request.Form("emailAddress ")
And it works fine
But I want to store the Id not the email address. From My stored procedure I get the login information
The Id output is
<%# Get_Login.FieldValue("Id", Container) %>
How do I merge the two?
Cheers
I am trying to set a cookie in ASP.NET
What I want to do is store the Id of the logged in user into a cookie.
What I have is
Response.Cookies("LoggedIn
Response.Cookies("LoggedIn
And it works fine
But I want to store the Id not the email address. From My stored procedure I get the login information
The Id output is
<%# Get_Login.FieldValue("Id",
How do I merge the two?
Cheers
ASKER
Yes, Thats exactly what I am after.
What is the correct Syntax to do that.
The Get_Login is the name of my stored procedure.
Sorry if the question seems basic. I am a php devloper and a client of ours needs this proj in vb.net
Its only my second day learning vb.net.
I thought something like
Response.Cookies("LoggedIn User").Val ue = Get_Login.FieldValue("Id", Container)
But that doesnt do it.
Cheers
What is the correct Syntax to do that.
The Get_Login is the name of my stored procedure.
Sorry if the question seems basic. I am a php devloper and a client of ours needs this proj in vb.net
Its only my second day learning vb.net.
I thought something like
Response.Cookies("LoggedIn
But that doesnt do it.
Cheers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks mate.
You'd just create a method which returns the ID from the stored proc and set Response.Cookies("LoggedIn