문제

@model mymodelsnamespace

    @using (Html.BeginForm("MyMethodName", "MyContollerName", FormMethod.Post)) 
    {
         @Html.EditorFor(m => Model, "Submit", new { multiple = true }) 
        <input type="submit" value="Submit" />
    }

I know the code I am going write will be close to whats above

How do I passed the updated model into MyMethodName is i can continue to manipulate it in my controller?

Please provide the signature for MyMethodName and the cshtml to give the model to the method in the controller.

도움이 되었습니까?

해결책

If you add this code to your controller, it should work.

[HttpPost]
public ActionResult MyMethodName (YourModel model)
{
    ... some code here.

}

You may find the Model-View-ViewModel pattern interesting.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top