Reputation: 12367
I'm using John Culviner's jquery.filedownload plugin.
For that to work I need to write a cookie. How do I write a cookie from within a static webmethod? As Page. Response is an instance field I cannot access it from a static method.
Upvotes: 3
Views: 4261
Reputation: 25214
var myCookie = new HttpCookie("CookieName");
myCookie["key"] = "val";
HttpContext.Current.Response.Cookies.Add(myCookie);
Upvotes: 7
Reputation: 37
use the ff: code:
HttpCookie objHTTPCk = HttpContext.Current.Request.Cookies.Get("Cookie name");
Upvotes: 1