Defina um objeto anônimo no argumento HtmlAttributes
da seguinte forma:
@Html.DropDownListFor(modelItem => item.EscolhaBanco, new SelectList(new List<Object>
{
new {value = 0, text = ""},
new {value = 1, text = "Bradesco"},
new {value = 2, text = "Santander"}
}, new { id = "IdDoMeuDropDownList" }))
EDIT
Para passar o valor selecionado para o Controller, você vai ter que usar um <button>
ao invés de um ActionLink
. Ficaria da seguinte forma:
@using (Html.BeginForm())
{
<td>
@Html.DropDownListFor(modelItem => item.EscolhaBanco, new SelectList(new List<Object>
{
new {value = 0, text = ""},
new {value = 1, text = "Bradesco"},
new {value = 2, text = "Santander"}
}, "value", "text", 0))
</td>
<input type="submit" value="Enviar" class="btn btn-default" />
}
Não sei se você definiu uma ViewModel pra isso, mas o correto é definir a ViewModel e fazer a View usá-la:
namespace MeuProjeto.ViewModels
{
public class EscolhaBancoViewModel
{
public int EscolhaBanco { get; set; }
}
}
A View fica assim:
@model MeuProjeto.ViewModels.EscolhaBancoViewModel
@using (Html.BeginForm())
{
<td>
@Html.DropDownListFor(modelItem => item.EscolhaBanco, new SelectList(new List<Object>
{
new {value = 0, text = ""},
new {value = 1, text = "Bradesco"},
new {value = 2, text = "Santander"}
}, "value", "text", 0))
</td>
<input type="submit" value="Enviar" class="btn btn-default" />
}
E o Controller:
public ActionResult MinhaAction(EscolhaBancoViewModel viewModel)
{
// O valor vai aparecer em viewModel.EscolhaBanco
}