Solved

Fill DropDownList from an enum

Posted on 2007-11-30
2
2,181 Views
Last Modified: 2008-02-01
//Available via App_Code folder to all web pages...
    public enum PeriodTypes
    {
        Monthly = 1,
        Weekly,
        Daily,
        Yearly,
        BiYearly
    }

Can I fill a DropDownList using this enum, either by looping or straight assignment?

If I delete, modify, or add to the enum ... would the drop down list pick up the change?

And is it a "good idea" to do it that way? Or am I asking for trouble down the road?
0
Comment
Question by:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
anoyes earned 500 total points
ID: 20385328
http://geekswithblogs.net/jawad/archive/2005/06/24/EnumDropDown.aspx
http://forums.asp.net/p/916237/1040004.aspx

In this case it'd be Enum.GetNames(typeof(PeriodTypes))

The drop down should pick up the change so long as you re-compile after the change (assuming you deploy by pre-compiling).
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 20385349
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

731 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question