2013-02-27 3 views
1

MVC 4의 웹 프로젝트에서 RazorC#으로 작업하고 있습니다. 동적으로 항목을 표시하는 @Html.DropDownList을 사용했습니다.mvc4의 동적으로 생성 된 @ html.dropdown 컨트롤에 대한 툴팁

@Html.DropDownList의 모든 항목에 대해 ToolTip을 설정하고 싶습니다. 당신이 jQuery을 사용할 수 있습니다

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

답변

1

this에 따르면 DropDownList에 대한 이러한 기회가 없지만,

:

<script type="text/javascript"> 

    $(function() { 
    $("#CategoryID option").each(function() { 
     $(this).attr({'title': $(this).html()}); 
    }); 
    }); 
</script> 
이 내 코드입니다
관련 문제