|
@model MvcEnumDropDownList.Models.WeeklyEvent
@using MvcEnumDropDownList.Resources
@using MvcEnumDropDownList.Helpers
@using MvcEnumDropDownList.Models
@{
ViewBag.Title = "Home Page";
}
@*<h3>Basic usage - selecting an optional label</h3>
<p>
<span class="text">Html.EnumDropDownList</span>
@(Html.EnumDropDownList<WeekDay>("eventDay", "Select an item"))
</p>
<p>
<span class="text">Html.EnumDropDownListFor</span>
@(Html.EnumDropDownListFor<WeeklyEvent, WeekDay>(x => x.Day, "Select an item"))
</p>
*@
<h3>Using custom HTML attributes</h3>
<p>
<span class="text">Html.EnumDropDownList</span>
@(Html.EnumDropDownList<WeekDay>("eventDay", "Select an item", new { @class="select"}))
</p>
<p>
<span class="text">Html.EnumDropDownListFor</span>
@(Html.EnumDropDownListFor<WeeklyEvent, WeekDay>(x => x.Day, "Select an item" , new { id="myday", @class="select"}))
</p>
<h3>Using [LocalizationEnum] attribute</h3>
<p>
<span class="text">Html.EnumDropDownList</span>
@(Html.EnumDropDownList<WeekDay>("selectDay", ""))
</p>
<p>
<span class="text">Html.EnumDropDownListFor</span>
@(Html.EnumDropDownListFor<WeeklyEvent, WeekDay>(x => x.Day, "", new {id = "myWeekDay"}))
</p>
<h3>Specifying the resource object type</h3>
<p>
<span class="text">Html.EnumDropDownList</span>
@(Html.EnumDropDownList<WeekDay, MyOtherResources>("selectDay", ""))
</p>
<p>
<span class="text">Html.EnumDropDownListFor</span>
@(Html.EnumDropDownListFor<WeeklyEvent, WeekDay, MyOtherResources>(x => x.Day, "", new {id = "myEventDay"}))
</p>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
My name is Rui Jarimba and I was born in Madeira island, Portugal and I currently live in Rome, Italy.
I have more than 10 years of experience developing software using the .NET Framework and other technologies (Web development, Databases, ...).
Some of my professional interests are: software development best practices, software architecture, cloud computing, Continuous Integration (CI), Continuous Delivery (CD) and agile methodologies such as Scrum, Kanban, Lean and any other methodology that can help me to become a better and more productive software engineer.
I believe in good code - code that is readable, maintainable, reusable, testable and deployable. This means that I'm not the "quick and dirty" type, I write code for the medium/long term whenever possible.
Something else about me - I love music, I am an amateur photographer, not a big fan of gyms (I prefer to do some outdoor activity such as walking/hiking), big foodie (I love Mediterranean cuisine and my glass of wine!).