I have a textbox, I need to set a cookie to the value of the textbox... when
textbox.Text changes.
How do I do this using clientSide script (javascript) only.
I do not want to post back to the server and then set the cookie using
server script.
Any help is very appretiated (I did search the internet)...
Nalakahttp://techpatterns.com/downloads/j...ipt_cookies.php
Pretty standard pattern, ASP.NET or otherwise.
:-)
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
*************************************************
Think Outside the Box!
*************************************************
"Nalaka" <nalaka12@.nospam.nospamwrote in message
news:%23vE8eBAwGHA.1956@.TK2MSFTNGP02.phx.gbl...
Quote:
Originally Posted by
Hi,
I have a textbox, I need to set a cookie to the value of the textbox...
when textbox.Text changes.
>
How do I do this using clientSide script (javascript) only.
>
I do not want to post back to the server and then set the cookie using
server script.
>
Any help is very appretiated (I did search the internet)...
Nalaka
>
>
Hi Nalaka,
I think the article Gregory provided is quite good and useful.
BTW, client-side inserted cookie may escape some special characters. When
reading them in server-side code, you may take care on this, you can use
the UrlDecode method to decode them if the cookie(added at client-side) is
escaped:
foreach (string key in Request.Cookies.Keys)
{
Response.Write("<br/>" + key + ": " +
Server.UrlDecode(Request.Cookies[key].Value));
}
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Thanks all.....
"Steven Cheng[MSFT]" <stcheng@.online.microsoft.comwrote in message
news:pLngR8CwGHA.1992@.TK2MSFTNGXA01.phx.gbl...
Quote:
Originally Posted by
Hi Nalaka,
>
I think the article Gregory provided is quite good and useful.
>
BTW, client-side inserted cookie may escape some special characters. When
reading them in server-side code, you may take care on this, you can use
the UrlDecode method to decode them if the cookie(added at client-side) is
escaped:
>
foreach (string key in Request.Cookies.Keys)
{
Response.Write("<br/>" + key + ": " +
Server.UrlDecode(Request.Cookies[key].Value));
}
>
Sincerely,
>
Steven Cheng
>
Microsoft MSDN Online Support Lead
>
>
This posting is provided "AS IS" with no warranties, and confers no
rights.
>
0 comments:
Post a Comment