1

I'm working on web project in MVC 4 with Razor and C#. I have used @Html.DropDownList that display items dynamically.

I want to set ToolTip for every item of @Html.DropDownList. This is my code:

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

1 Answer 1

1

According to this there is no such an opportunity for DropDownList, but

you can use jQuery:

<script type="text/javascript">

  $(function() {
  $("#CategoryID option").each(function() {
      $(this).attr({'title': $(this).html()});
    });
  });
</script>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.