473,385 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

set a cookie clientside on Textbox onChange

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
Aug 15 '06 #1
3 2134
http://techpatterns.com/downloads/ja...pt_cookies.php
Pretty standard pattern, ASP.NET or otherwise.
:-)

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think Outside the Box!
*************************************************
"Nalaka" <na******@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
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


Aug 15 '06 #2
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.

Aug 15 '06 #3
Thanks all......
"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:pL**************@TK2MSFTNGXA01.phx.gbl...
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.

Aug 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: vbMark | last post by:
What am I doing wrong here? <% UserID = Request.Cookies("emu")("UserID") %> <TABLE> <TR> <TD>UserID: <INPUT id=UserID value="<%=UserID%>"></TD> </TR>
7
by: What-a-Tool | last post by:
How does the expire date work setting it server side with asp. I know with javascript setting it client side it will be set to the clients local time, and therefore expire when the clients local...
4
by: Zeebra3 | last post by:
Here goes: I have a web form with several asp:dropdownlists, with which, when selection is changed I want to fire an event defined in some clientside js. The content of the clientside code is...
1
by: Kathy Burke | last post by:
Hi, I have a textbox and a calendar popup window. I got this from a posting (sorry, his name escapes me at the moment). It's nice and simple, so I like it, of course. Only problem I have is that...
9
by: Jerry | last post by:
In limiting textbox input to 500 characters I would like to include a dynamic count of characters input while the user is typing into a textbox. This would obviously be a client side control,...
3
by: Sandy | last post by:
Hello - I have a page that runs a stored procedure checking for the existence of a name in a database. If it exists, lblMessage returns text indicating same. When a user goes back and clears...
5
by: subhodey | last post by:
Hello, I have a ColdFusion online application that has a page having 2 textboxes. Corresponding to these 2 textboxes I have a Custom tag in coldfusion where the textbox is defined by <input...
1
by: Duncan | last post by:
Hi all, I'm tearing my hair out on this! I have a simple ASP.NET 2 page with a TextBox control, in the PreRender I set ClientSide events:- Response.Attributes.Add("onchange",...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.