有人知道如何从aspx.cs页面访问具有[webmethod]属性的静态方法中的httpRequest.cookies吗?
它不允许我这样做,因为方法是静态的。
[WebMethod] public static bool PostToTwitter(string identityUrl, string message, bool autoFollow) { Page.Request.Cookies -- object reference is required for non-static field
谢谢!
使用,
HttpContext.Current.Request.Cookies