Currently in a razor view I'm doing:
var request = Url.ActionContext.HttpContext.Request;
var builder = new UriBuilder(request.Scheme, request.Host.Host, request.Host.Port.Value, request.Path, request.QueryString.Value);
A problem with the above is that the port and query string might not be available.
Is there a better and shorter way to get the view's url?