|
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"
%>
|
|
|
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/
|
|
|
|
|
|
|
|