Click here to Skip to main content
15,886,362 members
Articles / Web Development / HTML

ASP.NET MVC: Creating localized DropDownLists for enums

Rate me:
Please Sign up or sign in to vote.
4.80/5 (12 votes)
6 Nov 2012CPOL1 min read 59.5K   1.4K   29  
A collection of HTML helpers that generate DropDownLists for enums, with or without localization support.
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.239
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace MvcEnumDropDownList.Resources {
    using System;
    
    
    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    public class MyOtherResources {
        
        private static global::System.Resources.ResourceManager resourceMan;
        
        private static global::System.Globalization.CultureInfo resourceCulture;
        
        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal MyOtherResources() {
        }
        
        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        public static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MvcEnumDropDownList.Resources.MyOtherResources", typeof(MyOtherResources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }
        
        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        public static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Friday_.
        /// </summary>
        public static string DayOfWeek_Friday {
            get {
                return ResourceManager.GetString("DayOfWeek.Friday", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Monday_.
        /// </summary>
        public static string DayOfWeek_Monday {
            get {
                return ResourceManager.GetString("DayOfWeek.Monday", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Saturday_.
        /// </summary>
        public static string DayOfWeek_Saturday {
            get {
                return ResourceManager.GetString("DayOfWeek.Saturday", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Sunday_.
        /// </summary>
        public static string DayOfWeek_Sunday {
            get {
                return ResourceManager.GetString("DayOfWeek.Sunday", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Thursday_.
        /// </summary>
        public static string DayOfWeek_Thursday {
            get {
                return ResourceManager.GetString("DayOfWeek.Thursday", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Tuesday_.
        /// </summary>
        public static string DayOfWeek_Tuesday {
            get {
                return ResourceManager.GetString("DayOfWeek.Tuesday", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Wednesday_.
        /// </summary>
        public static string DayOfWeek_Wednesday {
            get {
                return ResourceManager.GetString("DayOfWeek.Wednesday", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Friday_.
        /// </summary>
        public static string WeekDay_Friday {
            get {
                return ResourceManager.GetString("WeekDay.Friday", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Monday_.
        /// </summary>
        public static string WeekDay_Monday {
            get {
                return ResourceManager.GetString("WeekDay.Monday", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Saturday_.
        /// </summary>
        public static string WeekDay_Saturday {
            get {
                return ResourceManager.GetString("WeekDay.Saturday", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Sunday_.
        /// </summary>
        public static string WeekDay_Sunday {
            get {
                return ResourceManager.GetString("WeekDay.Sunday", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Thursday_.
        /// </summary>
        public static string WeekDay_Thursday {
            get {
                return ResourceManager.GetString("WeekDay.Thursday", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Tuesday_.
        /// </summary>
        public static string WeekDay_Tuesday {
            get {
                return ResourceManager.GetString("WeekDay.Tuesday", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Wednesday_.
        /// </summary>
        public static string WeekDay_Wednesday {
            get {
                return ResourceManager.GetString("WeekDay.Wednesday", resourceCulture);
            }
        }
    }
}

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Italy Italy
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!).

Comments and Discussions