Class ValidateUmbracoFormRouteStringAttribute
Attribute used to check that the request contains a valid Umbraco form request string.
Inheritance
System.Object
Namespace: Umbraco.Web.Mvc
Assembly: Umbraco.Web.dll
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class ValidateUmbracoFormRouteStringAttribute : FilterAttribute
Remarks
Applying this attribute/filter to a SurfaceController or SurfaceController Action will ensure that the Action can only be executed when it is routed to from within Umbraco, typically when rendering a form with BegingUmbracoForm. It will mean that the natural MVC route for this Action will fail with a HttpUmbracoFormRouteStringException.
Methods
View SourceOnAuthorization(AuthorizationContext)
Called when authorization is required.
Declaration
public void OnAuthorization(AuthorizationContext filterContext)
Parameters
Type | Name | Description |
---|---|---|
AuthorizationContext | filterContext | The filter context. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | filterContext |
HttpUmbracoFormRouteStringException | The required request field "ufprt" is not present. or The Umbraco form request route string could not be decrypted. or The provided Umbraco form request route string was meant for a different controller and action. |
ValidateRouteString(String, String, String, String)
Declaration
public void ValidateRouteString(string ufprt, string currentController, string currentAction, string currentArea)
Parameters
Type | Name | Description |
---|---|---|
System.String | ufprt | |
System.String | currentController | |
System.String | currentAction | |
System.String | currentArea |