How do i use a static class' property at design time

T

TS

i want to store my regular expressions in a static class with public
constants. I want to be able to pass a regular expression's id in a property
of a custom textbox so that in aspx page i could just set the expressionId
property and be done with it. i am trying to write as little code in code
behind as possible.

if this scenario, since i can't just use a singleproperty
"ClassName.PropertyName" since c# doesnt' have a stand alone Eval statement,
i could also have a property: regExClass that would default to a particular
one, which would be used to instantiate the class and then use the
expressionID property to access the correct property to set the reg ex.

does anyone have a better solution.

thanks
 
B

bruce barker

in your textbox make a enum property that sets the resource id. then the
designer will support it.

-- bruce (sqlwork.com)
 
W

Walter Wang [MSFT]

Hi TS,

As bruce suggested, if you're using an enum, the designer should support it
and you can easily choose one from the all available enum values; later you
can use the enum value to determine which regular expression to use.

Please feel free to let us know if there's anything unclear or we've
misunderstood anything.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
T

TS

i have created an enum as a property; of the textbox but I don't have
designer support for it.

also, what do you mean "sets the resource id"
 

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

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top