0
Answer

How to Save and retrieve Fckeditor value in Cookies.

Cien S

Cien S

14y
3.1k
1
Hi,

I want to save fckeditor value in cookies. And fckeditor have value as " Hi <name>,  and so on .."
I am using following code :

My Code:

Save:

  private void CookiesCreated()
    {
        //Create a new cookie, passing the name
        HttpCookie cookie = new HttpCookie("BodyText");

        //Set the cookies value
        cookie.Value = Server.HtmlEncode(fckeditor.Value);
       
        //Set the cookie to expire in 1 minute
        cookie.Expires = DateTime.Now.AddMinutes(1);

        //Add the cookie
        Response.Cookies.Add(cookie);

    }
Retrieve:

        if (Request.Cookies["BodyText"] != null)
        {
            fckeditor.Value = Server.HtmlDecode(Request.Cookies["BodyText"].Value);
        }

But i am uncomfortable to get the original value, i am getting only (<) this.
Please help me.

Thanks in advance