How to get only contents of the browser address bar, NOT full URI

milkman115544

New Member
Does anyone know if there's a clean way to get the contents of the browser address bar, not the absolute URI?I know you can use \[code\]Request.Url.AbsoluteUri\[/code\] to get the full request, and normally that would be fine. However, in this case I need to know if the user has landed on the page via the site's basic DNS.For example, if my site is called \[code\]http://www.mysite.com\[/code\], and the default page is page1.aspx, then Request.Url.AbsoluteUri returns \[code\]http://www.mysite.com/page1.aspx\[/code\] if a user hits the site from \[code\]http://www.mysite.com\[/code\]. In this case, all I want to get is: \[code\]http://www.mysite.com\[/code\]. Is this possible?The reason behind this is so that I can have the site embed statistical JavaScript code on the root page if the site is hit via the basic URL, and not if the page is included in the address bar. Does this make sense?
 
Top