I'm trying to retrieve the URL of the current page via a Web Method. The code below works well on a normal C# Method such as the Page_Load but does not work inside a Web Method.
public static void UpdateProjectName(string name)
string project_id = HttpContext.Current.Request.Url.ToString();
To get information of the client's previews request to current website you can use the UrlReferrer as follow:
//To get the Absolute path of the URI use this string myPreviousAbsolutePath = Page.Request.UrlReferrer.AbsolutePath; //To get the Path and Query of the URI use this string myPreviousPathAndQuery = Page.Request.UrlReferrer.PathAndQuery;