Click here to Skip to main content
15,910,878 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can Anyone ple answer this.


i want C# coding for if i add product to addtocart in that shows regarding pro_id and user_session stored in db using stored procedure.
Posted

you can use the user session like follows

Session["User"]="Something";

//or you can use the fllowing to store the user session uniquely

string userId = Session.SessionID;
 
Share this answer
 
Set session:
C#
Session["pro_id"] = "1";


Retrieve session:
C#
if(Session["pro_id"] != null)
{
   String pro_id = (String)Session["pro_id"];
}


More here:
http://msdn.microsoft.com/en-us/library/ms178581.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900