Create/generate an absolute URL in ASP.NET MVC Controller

Apparently, I forget stuff. So this code creates an absolute url that is an action/controller in my mvc application. Just add Request.Url.Scheme to it, which forces it to generate an absolute URL.

[codesyntax lang=”php”]

string absUrl = Url.Action("Index", "Products", null, Request.Url.Scheme);

[/codesyntax]