C# Class Rebel.Cms.Web.Mvc.ActionFilters.SuccessfulOnRedirectAttribute

This checks if the result is a RedirectToRouteResult and if so either: - appends a 'success' query string with the parameter specified in the RouteData - Or, if a cookie is chosen, a new cookie will be created with the value of the parameter specified in the RouteData and a 'success' query string will be appended with the cookie id that was created
Inheritance: AbstractTempDataCookieFilter
Mostra file Open project: RebelCMS/rebelcmsxu5

Public Methods

Method Description
EnsureRouteData ( Controller controller, string key, object value ) : void

Utility for ensuring that the correct key/value is in the controller context's route data for the ActionFilter to perform its filtering properly. Useful for injecting the key/value when the route data doesn't already exist in the request

SuccessfulOnRedirectAttribute ( ) : System

Initializes a new instance of the SuccessfulOnRedirectAttribute class.

SuccessfulOnRedirectAttribute ( string routeDataKey ) : System

Initializes a new instance of the SuccessfulOnRedirectAttribute class.

Protected Methods

Method Description
AddQueryString ( System.Web.Mvc.RedirectToRouteResult result, System.Web.Mvc.ActionExecutedContext filterContext ) : void

Checks if we are using a cookie to store data or just the query string, if using the cookie then passes logic to the base class, otherwise puts the query string value in

CreateCookie ( System.Web.Mvc.ResultExecutedContext filterContext ) : void

Only create the cookie if its specified

GetTempDataKey ( ControllerContext filterContext ) : string

Returns the request id as the temp data key

GetTempDataValue ( ControllerContext filterContext ) : object

Returns the value to be stored in the cookie or query string

Private Methods

Method Description
GetController ( IController controller ) : IRequiresBackOfficeRequestContext

Gets the BackOfficeController type from the filter context's controller instance

GetValueFromRoute ( ControllerContext controllerContext ) : object

Returns the value to be stored in the cookie or query string

Method Details

AddQueryString() protected method

Checks if we are using a cookie to store data or just the query string, if using the cookie then passes logic to the base class, otherwise puts the query string value in
protected AddQueryString ( System.Web.Mvc.RedirectToRouteResult result, System.Web.Mvc.ActionExecutedContext filterContext ) : void
result System.Web.Mvc.RedirectToRouteResult
filterContext System.Web.Mvc.ActionExecutedContext
return void

CreateCookie() protected method

Only create the cookie if its specified
protected CreateCookie ( System.Web.Mvc.ResultExecutedContext filterContext ) : void
filterContext System.Web.Mvc.ResultExecutedContext
return void

EnsureRouteData() public static method

Utility for ensuring that the correct key/value is in the controller context's route data for the ActionFilter to perform its filtering properly. Useful for injecting the key/value when the route data doesn't already exist in the request
public static EnsureRouteData ( Controller controller, string key, object value ) : void
controller Controller
key string
value object
return void

GetTempDataKey() protected method

Returns the request id as the temp data key
protected GetTempDataKey ( ControllerContext filterContext ) : string
filterContext ControllerContext
return string

GetTempDataValue() protected method

Returns the value to be stored in the cookie or query string
protected GetTempDataValue ( ControllerContext filterContext ) : object
filterContext ControllerContext
return object

SuccessfulOnRedirectAttribute() public method

Initializes a new instance of the SuccessfulOnRedirectAttribute class.
public SuccessfulOnRedirectAttribute ( ) : System
return System

SuccessfulOnRedirectAttribute() public method

Initializes a new instance of the SuccessfulOnRedirectAttribute class.
public SuccessfulOnRedirectAttribute ( string routeDataKey ) : System
routeDataKey string The route data key.
return System