1

I need to show tool tip for the values of the dropdown list items when using,

@Html.DropDownListFor(n => n.SomeProp, new SelectList(Source, "Id", "Name"));

Here source refers to a IEnumerable collection.

I believe we don't have title property here in MVC as compared to webforms.. Can you pls suggest?

1

1 Answer 1

4

Little late on the response, but i'll throw my two cents in here just in case it could help answer it for someone else:

You should be able to pass the title property as an HTML attribute:

@Html.DropDownListFor(n=>n.SomeProp,
    new SelectList(Source, "Id", "Name"),new { @Title = "Tooltip here" })

http://msdn.microsoft.com/en-us/library/dd470329(v=vs.118).aspx

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.