Nuffnang

Your Ad Here

Thursday, December 17, 2009

Get URL of current page

string url = HttpContext.Current.Request.Url.AbsoluteUri;

Result: http://localhost:1302/TESTERS/Default6.aspx


string path = HttpContext.Current.Request.Url.AbsolutePath;

Result: /TESTERS/Default6.aspx

string host = HttpContext.Current.Request.Url.Host;

Result: localhost

1 comments:

bathmate said...

good posting.i like it. thank u. :)-


www.bathmateus.com