Using Surface Controller without refreshing the view
Hi All,
I'm in a situation where I MUST use surface controllers to handle forms data.
And I would like to do this without a page refresh, in another words without returning a View.
Is there a way to submit a form that is hooked to surface controller, handle the data and stay on the same page without a page reload ?
Hi Martin. Perhaps use ajax to call the surface controller and return json or pain text depending on what's needed. Just make sure the names of the form elements match the model.
public class CustomSurfaceController : SurfaceController
{
public JsonResult CustomMethod(CustomModel model) {
return Json(someObject);
}
}
Using Surface Controller without refreshing the view
Hi All,
I'm in a situation where I MUST use surface controllers to handle forms data. And I would like to do this without a page refresh, in another words without returning a View.
Is there a way to submit a form that is hooked to surface controller, handle the data and stay on the same page without a page reload ?
Hi Martin. Perhaps use ajax to call the surface controller and return json or pain text depending on what's needed. Just make sure the names of the form elements match the model.
is working on a reply...