Surface controller actions
Information about Surface Controller Actions Result Helpers in Umbraco
CurrentUmbracoPage
namespace RoutingDocs.Controllers;
public class MyController : SurfaceController
{
public MyController(
IUmbracoContextAccessor umbracoContextAccessor,
IUmbracoDatabaseFactory databaseFactory,
ServiceContext services,
AppCaches appCaches,
IProfilingLogger profilingLogger,
IPublishedUrlProvider publishedUrlProvider)
: base(umbracoContextAccessor, databaseFactory, services, appCaches, profilingLogger, publishedUrlProvider)
{
}
[HttpPost]
public IActionResult PostMethod()
{
if (!ModelState.IsValid)
{
return CurrentUmbracoPage();
}
return RedirectToCurrentUmbracoPage();
}
}RedirectToCurrentUmbracoPage
Querystring parameter using a string value
RedirectToCurrentUmbracoUrl
RedirectToUmbracoPage
Last updated
Was this helpful?