1

MVC 4とでWebプロジェクトに取り組んでいRazorますC#。私は@Html.DropDownListその表示項目を動的に使用しました。

ToolTipのすべてのアイテムに設定したい@Html.DropDownList。これは私のコードです:

@Html.DropDownList("Config_Industry", ViewBag.Industry as IEnumerable<SelectListItem>, "Please Choose Item", new
{
    @class = "drpDownCustomEngineered",
    @style = "width: 258px;"                                               
})
4

1 に答える 1

1

これによると、そのような機会はありませんDropDownListが、

あなたが使用することができますjQuery:

<script type="text/javascript">

  $(function() {
  $("#CategoryID option").each(function() {
      $(this).attr({'title': $(this).html()});
    });
  });
</script>
于 2013-02-27T08:13:20.517 に答える