【发布时间】:2009-09-10 01:57:18
【问题描述】:
有谁知道如何通过 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
谢谢!
【问题讨论】:
标签: asp.net httprequest webmethod