asp.net 获取当前地址栏中完整的url

当url中没有带参数时可以使用:

HttpContext.Current.Request.Url.ToString() //例如:http://www.xxx.com/aaa.aspx

当url中带参数时可以使用:

HttpContext.Current.Request.Url.PathAndQuery.ToString()//例如:http://www.xxx.com/aaa.aspx?id=100 

你可能感兴趣的:(url,asp.net)