If you have a list view you can do this:
Define a select list:
@{
var Acciones = new SelectList(new[]
{
new SelectListItem { Text = "Modificar", Value =
Url.Action("Edit", "Countries")},
new SelectListItem { Text = "Detallar", Value =
Url.Action("Details", "Countries") },
new SelectListItem { Text = "Eliminar", Value =
Url.Action("Delete", "Countries") },
}, "Value", "Text");
}
Use the defined SelectList, creating a diferent id for each record (remember that id of each element must be unique in a view), and finally call a javascript function for onchange event (include parameters in example url and record key):
@Html.DropDownList("ddAcciones", Acciones, "Acciones", new { id =
item.CountryID, @onchange = "RealizarAccion(this.value ,id)" })
onchange function can be something as:
@section Scripts {
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
<script type="text/javascript">
function RealizarAccion(accion, country)
{
var url = accion + '/' + country;
if (url != null && url != '') {
window.location.href = url ;
}
}
</script>
@Scripts.Render("~/bundles/jqueryval")
}