he seguido las instrucciones de esta entrada: Asp.net mvc3 razor with multiple submit buttons y aquí está mi modelo:MVC4 - Una forma 2 botones de envío
public class AdminModel
{
public string Command { get; set; }
}
Mi controlador
[HttpPost]
public ActionResult Admin(List<AdminModel> model)
{
string s = model.Command;
}
Mi Ver
@using (Html.BeginForm("Admin", "Account"))
{
<input type="submit" name="Command" value="Deactivate"/>
<input type="submit" name="Command" value="Delete"/>
}
Cuando publico nuevamente, la cadena "s" siempre es nula.
También probé la segunda respuesta (la de 146 votos) en esta publicación del foro: How do you handle multiple submit buttons in ASP.NET MVC Framework? y eso también es nulo. ¿Qué estoy haciendo mal?
http://stackoverflow.com/questions/2423041/using -two-submit-buttons-inside-single-form/2426152 # 2426152 ¿Qué le parece esto? – takepara