I have a URL like this:
http://www.example.com/mypage.aspx?myvalue1=hello&myvalue2=goodbye
I want to get http://www.example.com/mypage
http://www.example.com/mypage
simple example would be using substring like :
string your_url = "http://www.example.com/mypage.aspx?myvalue1=hello&myvalue2=goodbye"; string path_you_want = your_url .Substring(0, your_url .IndexOf("?"));