Saturday, 18 January 2014

jQuery Get Cookie Value in Asp.Net Website C# or Retrieve Cookie Value in Asp.net

Here I will explain how to get jQuery cookie value in asp.net website using c# or retrieve cookie value from asp.net.

Description:
  
In previous articles I explained create, read or get cookie values in jQuery,  jQuery show loading image while pageloads, jQuery wiki plugin to show Wikipedia description,
jQuery Bind double click event to button control, jQuery create rounded corners for textboxand many articles relating to JavaScript, jQuery, asp.net codesnippets, cookie, asp.net. Now I will explain simple codesnippets how to get cookie value in asp.net using c#.


If we want to get cookie value in asp.net we need use Request.Cookies for that we need to write code like as shown below

if (Request.Cookies["UserId"] != null)
{
string username = Request.Cookies["UserId"].Value;
}

No comments:

Post a Comment