tag:blogger.com,1999:blog-8980734269859237005.post2674518688447776546..comments2024-01-30T01:03:21.768-08:00Comments on DevCurry: How to Bind An Enum Name and Value to an ASP.NET DropDownListSuprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-8980734269859237005.post-10982077734011078352011-03-30T08:15:43.710-07:002011-03-30T08:15:43.710-07:00This doesn't allow sorting of the values in th...This doesn't allow sorting of the values in the dropdown.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8980734269859237005.post-2236875467607527542009-09-17T00:39:59.476-07:002009-09-17T00:39:59.476-07:00Ok,
Personally I would recommend using this appro...Ok,<br /><br />Personally I would recommend using this approach instead:<br /><br />if (!Page.IsPostBack)<br />{<br />this.DropDownList1.DataSource = Enum.GetValues(typeof(Speed));<br />this.DropDownList1.DataBind();<br />}<br /><br />* The "if not Page.IsPostBack" check is important. Without it you will re-bind the list on every page load!<br /><br />Then in the code behind to get the Anonymousnoreply@blogger.com