I have the following code.
private Enum MyEnum
{
VALUE1=5, VALUE2=4, VALUE3=3, VALUE4=2, VALUE5=1
}
protected void Page_Load(object sender, EventArgs e)
{
Session["EnumValue"] = "VALUE1";
MyEnum test = (MyEnum) Session["EnumValue"];
}
In the page load, after the casting i have the value of the variable 'test' = 'VALUE2'.
I am expecting it to get test ='VALUE1'. Is there anything wrong with the code