asp.net mvc 2 - PartialView and HTTPPOST action -
i've problem partial view , controller httppost action : when i'm in httppost partialview, partial return, not index page partialview.
i don't understand why!
the context :
i've offer(associated viewmodel), composed of 4 parts : client, swimmingpool, cover, resume make offer on single page partialview, 1 per parts.
code in view (offer/index) :
<asp:content id="content2" contentplaceholderid="maincontent" runat="server"> <h2>index</h2> <% html.renderaction("p_client"); %> </asp:content>
code in controller :
public class offercontroller : controller {
public actionresult index() { return view(); } [httpget, childactiononly] public actionresult p_client(string id) { blablabla return partialview("p_client", viewmodel); } [httppost] public actionresult p_client(offerviewmodel viewmodel) { return partialview(viewmodel); } }
}
the code in post action says
return partialview(viewmodel);
so that's - returns partial view. change
return view("index", viewmodel);
Comments
Post a Comment