Hey There,
I have a piece of code inside a User Control that builds some links and appends query strings. When I click on those links in a browser, they appear to be linking from the "Includes" folder which contains my User Control and not the actual URL of the page.
I have solved the issue for links that link to and from the same page (IE. queries, #anchor link etc...) by appending Page.Request.Url.AbsoluteUri to the front of the link.
But how do I link to other pages?
The only solution I can think of is to somehow get all of the current URL before the last "/" slash and append the new page:
For example, if this is the current URL:
http://www.mysite.com/people/users/profiles/edit.aspx
I need to build the links like so:
http://www.mysite.com/people/users/profiles/ + "newpage.aspx?something=4"
Right now, this is what I get: ...
Go to the complete details ...