Author: stevesimon | Posted on: 9/24/2009 10:28:01 AM | Views : 617

Hello,
I'm converting all my code to C# and hit stumbling blocks here and there. The latest is rgearding type conversion. I have a string stored in a cookie that determines a user's level. The user level is an Enum in my code:
public enum Role
    {
        IsAdmin = 100,
        IsUser = 10,
        IsFake = 0
    }
So what I'm trying to do is this: UserLevel = (Role)(Request.Cookies["kdhrental"]["role"]);
That throws an error that I cannot convert type'string' to Role. This works in VB. What do I need to do?
Thanks!

...

Go to the complete details ...