Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
aspx.cs页面中的ASP.NET Webmethod无法访问page.Request对象_Asp.net_Httprequest_Webmethod - Fatal编程技术网

aspx.cs页面中的ASP.NET Webmethod无法访问page.Request对象

aspx.cs页面中的ASP.NET Webmethod无法访问page.Request对象,asp.net,httprequest,webmethod,Asp.net,Httprequest,Webmethod,有人知道如何从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 f

有人知道如何从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