views:

20

answers:

2

i have enum

 public enum TypeImage
{
    Img=0,
    Thumb=1
}

i want in view show <%= TypeImage.Img %> -it shows "img" but not 0. what the problem?

A: 

maybe something like:

<%= Convert.ToInt32(TypeImage.Img) %>
John Boker
A: 

To show 0 you need to cast enum to integer:

<%= (int)TypeImage.Img %>
Andrew Bezzub