In SharePoint how do you get the url of the page you are on from the code behind? e.g. with the blah.aspx page included...
SPContext.Current.Web.Url gives http://vm/en/
I need it with http://vm/en/Pages/blah.aspx
In SharePoint how do you get the url of the page you are on from the code behind? e.g. with the blah.aspx page included...
SPContext.Current.Web.Url gives http://vm/en/
I need it with http://vm/en/Pages/blah.aspx
Try: SPContext.Current.File.Url
You could also use HttpContext.Current.Request.Url
You can still get the HTTPContext and then use HTTPContext.Current.Request.Url
SPContext.Current.Web is the SPWeb surrounding the page you're on, and thus its URL is the URL of the Web, not the page.
Try : SPContext.Current.Web.Url +"/"+ SPContext.Current.File.Url