in

Chennai .Net User Group

A platform that enables you to Learn, Share & Grow (India's first .Net user group)

Shiju Varghese's Blog

September 2008 - Posts

  • Default option label for DropDownList in ASP.NET MVC Preview 5

    The ASP.NET MVC Preview 5 has provided the functionality to add a default option label for DropDownList control. For adding a default option label, provide the default label as the first argument of the DropDownList helper method. This will render the default option label element with its value attribute equal to an empty string, but with its inner text as the value that you provide.

    Normal 0 false false false /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;}

    <%=Html.DropDownList("--Select Customer--","Customer") %>
Copyright © 2002-2008 Chennai .Net User Group. All Rights Reserved. Microsoft and Microsoft logo's are trademarks of Microsoft Corporation