I am writing an Authorize filter attribute adn I\'m having trouble figuring out how to get the current url as a string so I can pass it as a parameter to the LogOn action. The g
To get the complete URL
you can try as suggested by the @rboarman
but usually the RedirectUrl
will be the relative url and for that you have to try the the RawUrl
property of the Request
object.
filterContext.HttpContext.Request.Url ===> http://somesite.com/admin/manage
filterContext.HttpContext.Request.RawUrl ====> /admin/manage
EDITED: Fixed the second example