如何将每个页面的文本框值存储到cookie中. [英] How to store every page textbox value into cookies.

查看:602
本文介绍了如何将每个页面的文本框值存储到cookie中.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何将每个页面的文本框值存储到cookie中.
我有10个asp.net网络表单等等.我想将每个页面的文本框数据存储在cookie中.不要删除上一页文本框的值,它将添加它,我想作为单独的文本框数据进行访问.

请帮助我........
谢谢...

Hi,

How to store every page textbox value into a cookies.
I have 10 asp.net webforms and more. I want store my every page textbox data in a cookies. Dont delete previous page textbox value, it will add it, I want to access as individual textbox data.

Please Help me........
Thank you...

推荐答案

您好,

根据RFC 2109,每个用户代理都需要支持

    每个cookie至少
  • 300个cookie
  • 至少4096个字节(根据Set-Cookie标头的语法说明中组成cookie的非终端字符的大小来衡量)
  • 每个唯一主机或域名至少20个Cookie
Hello,

As per RFC 2109 every user agent needs to support

  • at least 300 cookies
  • at least 4096 bytes per cookie (as measured by the size of the characters that comprise the cookie non-terminal in the syntax description of the Set-Cookie header)
  • at least 20 cookies per unique host or domain name
// Read search phrases 
if (Request.Cookies["SearchPhrases"] != null) {
    string strVal = Request.Cookies["SearchPhrases"]["textBox1"].Value;
}

// Update textbox1 value
Request.Cookies["SearchPhrases"]["textBox1"].Value = strNewValue


问候


这篇关于如何将每个页面的文本框值存储到cookie中.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆