web user control property values

  • Thread starter Thread starter Andy B
  • Start date Start date
A

Andy B

I have a web user control that has a property called ViewMode. The property
is an int and can be the values 1, 2 or 3 (the different view modes of the
control). I have an enum defined called NewsViewMode that defines what 1, 2
and 3 actually mean so I don't forget the values in code. What I need to do
is be able to do something like ViewMode="Archive" instead of ViewMode=3.
Makes it easier to remember a word than it does a number. How would I do
this?
 
I needed to know how I would do ViewMode="archive" instead of ViewMode=1?

Well, that is what I tried to answer as well. You simply need to declare
the property with the right type (your custom enum type), and then you are
able to declaratively assign it as ViewMode="Archive".
 
Back
Top