I agree I am not getting it, because normally when I want to use a WEb
Control in another assembly, I just drag in the webcontrol and it is
registered, and you can use the things in that assembly. But the enum
values
don't appear.
Well, when you "drag in the webcontrol" (from where do you drag it?),
obviously something happens that allows the class defining the web control
to be used. The class is a type, just like an enum is a type.
So even if the Designer is doing something automatic, you should be able
to look at the source code it generates that allows you to use the web
control type, and replicate that so that you can use the enum type. If
the two types are declared in the same source file and namespace, I would
expect the enum to practically "just work", but if not, it can't be that
hard.
Unfortunately, I don't have any direct experience with the web control
part of .NET. Your question has a straightforward answer for a regular C#
application, but if you get HTML and a web server involved, it goes
outside my realm of experience. I suspect the answer is as
straightforward as it is for a regular C# application, but I can't tell
you for sure.
When i put it inside the class it works, when it is not in the class it
does
not work.
Maybe my question isn't about enums maybe it is about how some parts of
some
namespaces are automatically registered when other parts are not.
Maybe. But I doubt it. That's certainly not an issue with respect to
non-web applications. If you have access to anything declared in a given
assembly under a given namespace, you have access to everything in that
assembly under that namespace. You don't get "parts" of a namespace if
all the parts are in the same assembly.
I think that the advice Jon's offered is useful. Another thing you might
do is actually create two different projects in two different solutions,
one in which you declare the enum, and another in which you use it. The
first project will be built as a library, and the second as an
application. It complicates things a little, but it has the advantage of
clearly showing the relationship between a namespace, an assembly in which
things in that namespace are defined, and a different assembly that uses
the first one.
If the example Jon suggest clears things up, great. If not, consider
breaking it apart a little more as I describe above.
Finally, if none of that works, you may simply want to post a
concise-but-complete example of code that reliably demonstrates what
you're trying to do. Since it's apparently a web-based project, you may
want to provide a little extra detail about how the code is actually
used. For someone who already knows about using the web controls stuff,
that shouldn't be necessary, but if your question is really about C#,
posting a web control-based example without some information as to how to
use it will unnecessarily restrict the people who might otherwise be able
to answer the question (excluding, for example, me

).
Pete