Mik*_*yev 3 c# asp.net cookies static-methods
我正在使用John Culviner的jquery.filedownload 插件.
为了工作,我需要写一个cookie.如何在静态web方法中编写cookie?作为Page.Response是一个实例字段,我无法从静态方法访问它.
var myCookie = new HttpCookie("CookieName");
myCookie["key"] = "val";
HttpContext.Current.Response.Cookies.Add(myCookie);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3551 次 |
| 最近记录: |