I want to get part of the url in ASP.NET MVC
http://localhost:6223/RssFeed/RssFeedsLang?lang=Dari&开发者_如何学Goamp;cat=News
How can I get the http://localhost:6223/
of the url? Basically I want to discard /RssFeed/RssFeedsLang?lang=Dari&cat=News
in the url. How can I do that?
Use this:
string urlBase = Request.Url.GetLeftPart( UriPartial.Authority ) + Request.ApplicationPath;
精彩评论