http://blog.jarrin.net/JarrinBlog/Request_Url

Request.Url

Wednesday, December 15, 2010

ASP.NET's Request.Url object is super handy but I can never remember which of its properties I need to use. I always ended up setting a breakpoint and browsing through the actual values to determine which one I want to use.  And every time I do this I think to myself, "self, you should just build a test script and copy down all these values somewhere for reference". Finally, I have done this.

Request.Url.ToString(): http://localhost:1905/dev/deeper/default.aspx?key=value&key2=value2
Request.Url.AbsolutePath: /dev/deeper/default.aspx
Request.Url.AbsoluteUri: http://localhost:1905/dev/deeper/default.aspx?key=value&key2=value2
Request.Url.Authority: localhost:1905
Request.Url.DnsSafeHost: localhost
Request.Url.Fragment:  
Request.Url.Host: localhost
Request.Url.HostNameType.ToString(): Dns
Request.Url.IsAbsoluteUri.ToString(): True
Request.Url.IsDefaultPort.ToString(): False
Request.Url.IsFile.ToString(): False
Request.Url.IsLoopback.ToString(): True
Request.Url.IsUnc.ToString(): False
Request.Url.IsWellFormedOriginalString().ToString(): True
Request.Url.LocalPath: /dev/deeper/default.aspx
Request.Url.OriginalString: http://localhost:1905/dev/deeper/default.aspx?key=value&key2=value2
Request.Url.PathAndQuery: /dev/deeper/default.aspx?key=value&key2=value2
Request.Url.Port.ToString(): 1905
Request.Url.Query: ?key=value&key2=value2
Request.Url.Scheme: http
Request.Url.Segments.Length.ToString(): 4
Request.Url.Segments[0]: /
Request.Url.Segments[1]: dev/
Request.Url.Segments[2]: deeper/
Request.Url.Segments[3]: default.aspx
Request.Url.UserEscaped.ToString(): False
Request.Url.UserInfo:  
//Chronologically
< Previous: Microsoft Sucks - Exhibit 15,487 <
> Next: What good is math? >
Add a Comment

Comments

your name
your email (optional)