Deseja adicionar estilo com função onchange na lista suspensa meu código é algo assim: -
@Html.DropDownListFor(m=>m.printEmployeeCardDTO.DataCardConnectionType,null,new { @onchange="_printEmployeeCard.GetPrintersDetail(this.value, printersList);" },new { style = "width: 100px;" } )
Estou com erro nisso. Alguém poderia me ajudar nisso?
Respostas:
2 para resposta № 1Você usou dois parâmetros diferentes new { }
em vez de apenas um separado por ,
@Html.DropDownListFor(
m => m.printEmployeeCardDTO.DataCardConnectionType,
null,
new { @onchange="_printEmployeeCard.GetPrintersDetail(this.value, printersList);", style = "width: 100px;" }
)
0 para resposta № 2
Use o @
assine com o atributo style, assim:
@style = "width: 100px;"