The Page
class instance has the Request
property so that you can easily work with it.
http://msdn.microsoft.com/en-us/library/system.web.ui.page.request%28v=vs.110%29.aspx
Your code being static method, instead, doesn't have access to Request
property, since static methods do not have access to instance members.
Use HttpContext.Current.Request.Url
instead of Request.Url
to make your code more universal.