asp.net mvc 3 - Calling another Controller post method -
i using asp.net mvc 3 website.
i have created partial view has "previous, next , save" buttons. calling partial view on master page.
my requirement on ever view must able call different save methods in different controllers passing respective model data controller actions.
example
- i have 4 step data input, have different controller each step.
- if on step 1 , click save form values should go
step1controller's action method, - if on step 2 post should call
step2controller
something this:
public actionresult save(genericmodel model) { //use reflection find out model type //call appropriate controller action model return redirecttoaction("create", new { controller = "conference", action = "create" }); } this save method called save button on master page. how can achieve this?
are forms on separate actions on controllers?
if so, set form action on each page point relevant controller. form 1 is
<form method="post" action="/step1controller/action"> form 2 is:
<form method="post" action="/step2controller/action"> does solve problem?
Comments
Post a Comment