从后面的代码中读取Cookie值 [英] Read Cookie value from code behind

查看:118
本文介绍了从后面的代码中读取Cookie值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



现在我的要求是从客户端脚本(jquery)创建cookie并从后面的代码中读取cookie。这里我有3个按钮。点击按jquery创建的按钮新cookie。所以,如果我再次点击这三个按钮,我收到了警告信息:你已经点击了。这是由jquery创建的cookie。但是不知道如何阅读从客户端创建的cookie。



全部谢谢,



Dhinesh kumar Velmayil

解决方案

请看这些:



ASP.NET Cookie概述 [ ^ ]



ASP.NET中的Cookie基础知识 [ ^ ]


尝试如下...

 HttpCookie cookie = Request.Cookies [  cookieName< /跨度>]; 


Hi All,

Now my requirement is to create cookie from client side script(jquery) and read that cookie from code behind. Here i have 3 buttons. When am click the button fresh cookie created by jquery. So if am click once again among the three buttons i got alert message ex: already you clicked. Here am cookie created by jquery. But dont know how to read cookie which is created from client side.

Thanks All,

Dhinesh kumar Velmayil

解决方案

See these :

ASP.NET Cookies Overview[^]

Basics of Cookies in ASP.NET[^]


Try like below...

HttpCookie cookie = Request.Cookies["cookieName"];


这篇关于从后面的代码中读取Cookie值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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