web user control property values

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?
 
J

Joern Schou-Rode

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".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top