Skip to main content

Cookies example in ASP.net

Add Value in Cookies

 Response.Cookies["Cookies"].Value = txtEmailID.Text;
Response.Cookies["Cookies"].Expires = DateTime.Now.AddMonths(2);

Get Value From Cookies

Request.Cookies["Cookies"]

Clear Cookies

Response.Cookies.Clear();

Comments

Popular posts from this blog

crystal reports using stored procedures in asp.net

  crystal reports using stored procedures in asp.net   ReportDocument document = new ReportDocument ();         document.Load( this .Page.Server.MapPath( "~/CRY/crTest.rpt" ));         string str = ConfigurationManager .AppSettings[ "ConnectionString" ];         string server = str.Substring(str.IndexOf( "=" ) + 1, str.IndexOf( ";" ) - (str.IndexOf( "=" ) + 1));         str = str.Substring(str.IndexOf( ";" ) + 1);         string database = str.Substring(str.IndexOf( "=" ) + 1, str.IndexOf( ";" ) - (str.IndexOf( "=" ) + 1));         str = str.Substring(str.IndexOf( ";" ) + 1);         string user = str.Substring(str.IndexOf( "=" ) + 1, str.IndexOf( ";" ) - (str.IndexOf( "=" ) + 1));        ...

Encryption Decryption Helper

Encryption Decryption Helper public class clsEncryptionDecryption { #region Variable Declaration private static string keyString = " keyString "; #endregion #region Methods/Functions /// <summary> /// Get Encrpted Value of Passed value /// </summary> /// <param name="value"></param> /// <returns></returns> /// <remarks></remarks> public static string GetEncrypt( string value) { return Encrypt(keyString, value); } /// <summary> /// Get Decrypted value of passed encrypted string /// </summary> /// <param name="value"></param> /// <returns></returns> /// <remarks></remarks> public static string ...