【发布时间】:2016-02-13 08:26:11
【问题描述】:
我正在尝试通过 Web 方法检索当前页面的 URL。下面的代码在普通的 C# 方法(如 Page_Load)上运行良好,但在 Web 方法中不起作用。
[WebMethod(EnableSession=true)]
public static void UpdateProjectName(string name)
{
string project_id = HttpContext.Current.Request.Url.ToString();
}
我收到一个空字符串 ("") 作为 project_id。我做错了什么?
【问题讨论】:
标签: c# asp.net web-services asp.net-web-api webmethod