c# - Correlation between submit and beginform -
i have problem when trying render multiple models in view.
lets have:
model
public int id { get; set; } public arrayofthings[] things { get; set; }
view
for (int = 0; model.things.count() > i; i++) { using (html.beginform("action", "controller", formmethod.post, new { id = })) { <p>@html.checkboxfor(m => m.things[i].isdone, "some check")</p> <input type="submit" title="delete" value="check done" name="btn_submit" /> } }
how input (submit) button correlate right form? is, first form being affected.
i think maybe need change mind. why creating new form?? can use action link instead of submit button , send data through actionlink parameters.
<%=html.actionlink("link text", "action", "controller", new {id = "1"}, null)%>
Comments
Post a Comment