How to change id value when using Html.DropDownListFor helper in asp.net mvc 2.0?

前端 未结 2 1917
暗喜
暗喜 2021-02-19 00:49

I have a partial view that has something like this

 <%= Html.DropDownListFor(m => m.SelectedProductName, Model.ProductList, \"Select a Product\") %>
         


        
2条回答
  •  日久生厌
    2021-02-19 01:21

    You can use a hardcoded jQuery:

    $('select#[id of your select box]').attr('id', '[id that you want]');
    

提交回复
热议问题