MVC3 Retrieving the browser Url

Code Snippet
  1. Public Module MyUrlExtensions
  2.     <Extension()> _
  3.     Public Function UrlOriginal(ByVal request As HttpRequestBase) As Uri
  4.         Dim hostHeader As String = request.Headers(“host”)
  5.         Return New Uri(String.Format(“{0}://{1}{2}, request.Url.Scheme, hostHeader, request.RawUrl))
  6.     End Function
  7. End Module
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s