>>>I created a Web Control. In it is this enum:
>>>
>>>
>>>public enum PageMode
>>>{
>>> New,
>>> Edit,
>>> View
>>>}
>>>
>>>
>>>From outside the control I'm trying to do:
>>>
>>>
>>>crlRoles.SetPageMode(crlRoles.PageMode.Edit);
>>>
>>>
>>>I'm getting a compile error "'PageMode': cannot reference a type through an expression; try 'crlRoles.PageMode' instead".
>>>
>>>How do I do this in an ASP.Net app?
>>
>>I generally find it better not to place enums inside of classes unless you only plan on using it within the class. That doesn't seem to be the case here, so why not put the enum in its own file and move it outside the class. In web apps I have a folder called Enums and I put them all in there where they are used in the web pages.
>>Tim
>
>In a stand-alone CS file?
Yes, it does not need to be in a class. Much easier to make it accessible for those type situations.
Timothy Bryan