codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  ASP Cookies  gdatay at 04:13 on Wednesday, October 13, 2010
 


how can i set the cookies to get the value of the textbox not the declare value....

<%
Response.Cookies("id")="20100001"
Response.Cookies("id").Expires="May 10,2002"
%>

  Re: ASP Cookies  Elain at 03:05 on Friday, October 22, 2010
 

There is an example:

<HTML>
<BODY>
设置与读取 cookies...

<INPUT TYPE = BUTTON Value = "设置cookie" onClick = "Set()">
<INPUT TYPE = BUTTON Value = "读取cookie" onClick = "Get()">

<INPUT TYPE = TEXT NAME = Textbox>
</BODY><p style=line-height: 150%>
<SCRIPT LANGUAGE="JavaScript">
function Set(){
var Then = new Date()
Then.setTime(Then.getTime() + 60*1000 ) //60秒
document.cookie = "Cookie1=测试数据;expires="+ Then.toGMTString()
}<p style=line-height: 150%>function Get(){
var cookieString = new String(document.cookie)
var cookieHeader = "Cookie1="
var beginPosition = cookieString.indexOf(cookieHeader)
if (beginPosition != -1){
document.all.Textbox.value = cookieString.substring(beginPosition
+ cookieHeader.length)
}
else
document.all.Textbox.value = "Cookie not found!"
}
</SCRIPT>
</HTML><p style=line-height: 150%>



I hope that the answer is helpful for you to solve the problom!
------------------------------------
http://www.sothink.com/product/swfeasy/
http://www.logo-maker.net/
http://www.menu-flash.com/








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Regular Savings Accounts
•  Re: ASP and Ms-access
•  Re: CSS 3.0 animation features
•  Re: Dhtml menu, submenu losing focus. I`m so close!
•  Re: ASP Cookies
•  Re: Difference between two dates including From & To date
•  Re: Need Javascript Multiple sidebar menu with sliding effects
•  Re: lightweight and heavyweight component
•  Re: Insert Contents of .txt file into a .html page


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010