Como pasar 2 parametros en asp.net mvc desde un dropdownlist
Publicado por Romer Ariel (1 intervención) el 24/05/2018 22:53:32
Estoy intentando pasar 2 parametros al metodo que se encuentra en el controlador desde la vista, pero solo me reconoce el valor del primer parametro, el otro llega como null, que estoy haciendo mal, este es el codigo.
Vista
Controlador
Ayuda por fa...
Vista
1
2
3
4
5
6
7
8
9
<table>
<tr>
<% foreach (var item2 in Model)
{ %>
<input type="hidden" id="idColegio" value="<%: item2.idColegio %>" />
<td><p style="color:black;font-size:medium">Gestiones:</p></td>
<td><%: Html.DropDownList("gest", new SelectList(ViewBag.gestiones, "Value", "Text"), htmlAttributes: new { @class = "form-control", onchange = "document.location.href = '/CursosOfrecidos/Index?id='+ this.options[this.selectedIndex].value , 'idColegio='+item2.idColegio", style = "width:150px;", @id = "ges", @name = "gestion" }) %></td>
</tr>
</table>
Controlador
1
2
3
4
public ActionResult Index(int id, int? idColegio )
{
return View(cursoso);
}
Valora esta pregunta
0