asp.net mvc 4 - single page with multiple partials and forms -



asp.net mvc 4 - single page with multiple partials and forms -

what best practice this:

i have list of partials on 1 page. each page has form on save info of partial.

i on main page:

@foreach (var taak in model) { @html.action("detailtaak", "checklist", new { trouwtaakid = taak.id }) }

then controller (where info filled):

public actionresult detailtaak(int trouwtaakid) { dto.trouw.trouwtaak viewmodel; viewmodel = _themaservice.gettrouwtaakbytrouwtaakid(trouwtaakid); homecoming view(viewmodel); }

the page gets build , list completed. when want save partial using code:

@using (html.beginform("detailtaak", "checklist", formmethod.post, new { @class = "form-horizontal col-md-12", role = "form", id = @model.id })) { @html.antiforgerytoken() @html.validationsummary(true, "", new { @class = "text-danger" }) @html.hiddenfor(model => model.id) ... }

it works do mainpage doesn't have reloaded ? post code:

[httppost] public actionresult detailtaak(dto.trouw.trouwtaak model) { if (modelstate.isvalid) { viewbag.savesuccess = "je instellingen zijn opgeslagen"; } homecoming view("detailtaak", model); }

with post code go detailtaak page instead of staying on main page , updating partial. doing wrong don't know way go.

kind regards

forms asp.net-mvc-4 asp.net-mvc-partialview

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -