Pergunta

@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.

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top