27 Temmuz 2015 Pazartesi

URL de farklı parçaları döndermek için "HttpContext.Current.Request." metodları ve örnekleri

URL used for this example:
http://localhost:12345/site/page.aspx?q1=1&q2=2
Value of HttpContext.Current.Request.Url.Hostlocalhost
Value of HttpContext.Current.Request.Url.Authoritylocalhost:12345
Value of HttpContext.Current.Request.Url.AbsolutePath/site/page.aspx
Value of HttpContext.Current.Request.ApplicationPath/site
Value of HttpContext.Current.Request.Url.AbsoluteUrihttp://localhost:12345/site/page.aspx?q1=1&q2=2
Value of HttpContext.Current.Request.RawUrl/site/page.aspx?q1=1&q2=2
Value of HttpContext.Current.Request.Url.PathAndQuery/site/page.aspx?q1=1&q2=2

Daha fazlası için: http://blog.ginzburgconsulting.com/getting-current-page-url-or-its-parts-in-c/