ButtonSettings.RouteValues Property
Defines the routing logic by specifying the names of a Controller and an Action which should handle clicks on a Button.
Namespace: DevExpress.Web.Mvc
Assembly: DevExpress.Web.Mvc5.v24.1.dll
NuGet Package: DevExpress.Web.Mvc5
Declaration
Property Value
Type | Description |
---|---|
Object | An object containing the Controller and Action names. |
Remarks
Using the RouteValues property together with the ButtonSettings.UseSubmitBehavior property, you can perform submissions to a specific action on button clicks. If the ButtonSettings.UseSubmitBehavior property is enabled, a click on a button submits the form to a controller action specified by the RouteValues property. If the ButtonSettings.UseSubmitBehavior property is disabled, a button click just performs a redirection to the action specified by the RouteValues property (like a click on a link).
public ActionResult Index()
{
return View();
}
public ActionResult Click()
{
return View();
}
public ActionResult ButtonAction(int customParameter)
{
TempData["customParameter"] = customParameter;
return RedirectToAction("Click");
}