I have this problem with my code, I get an exception during compilation. Can anyone help me out?
if (Page.IsPostBack != false)
{
System.Drawing.KnownColor enClr;
System.Collections.Generic.List<System.Drawing.KnownColor> ColorList;
ColorList.AddRange(Enum.GetValues(enClr.GetType()));
}
I'm trying to follow this guide in VB.Net, but I only use C# so I'm trying to translate as I go, can anyone help?
Here's the original code:
If Not IsPostBack Then
Dim enClr As System.Drawing.KnownColor
Dim clrs As New _
System.Collections.Generic.List _
(Of System.Drawing.KnownColor)
clrs.AddRange(System.Enum.GetValues _
(enClr.GetType()))
DropDownList1.DataSource = clrs
DropDownList1.DataBind()