title: ASP.NET MVC: putting custom attributes into option tag in select list
body: <p>I'm using ASP.NET MVC, and am trying to render a select list with the HtmlHelper.DropDownListFor method, like so:</p>
  
  <pre><code>&lt;%= Html.DropDownListFor(x =&gt; x.AllTopics, SelectListHelper.GetSelectListItems(Model.AllTopics), "Select a Topic", new { id = "allTopics", @class = "topic-dropdown" })%&gt;
  </code></pre>
  
  <p>where SelectListHelper just returns an <code>IList&lt;SelectListItem&gt;</code> from whatever collection we're passing in. This works fine for simple things, but I want to be able to add a title attribute to each <strong>option</strong> tag (<strong>not</strong> the <strong>select</strong> list itself). But the DropDownListFor only takes in an <code>IEnumerable&lt;SelectListItem&gt;</code>, and the SelectListItem does not have anyplace that I can put in the title attribute.</p>
  
  <p>Is there any way to do this without foregoing the DropDownListFor method and writing out the select list and each element by hand?</p>