i have enum
开发者_Python百科 public enum TypeImage
{
Img=0,
Thumb=1
}
i want in view show <%= TypeImage.Img %> -it shows "img" but not 0. what the problem?
maybe something like:
<%= Convert.ToInt32(TypeImage.Img) %>
To show 0 you need to cast enum to integer:
<%= (int)TypeImage.Img %>
精彩评论