Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question about accessing form objects...
Message
From
28/12/2002 11:09:18
 
 
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00736154
Message ID:
00736296
Views:
15
Kevin,

Rather than making all your controls public, expose them through Properties (with get/set methods). Will that work for you?

~~Bonnie


>Cathi/David...
>
>Thanks for the answer. I was originally using 'form'. When I changed the parameter on the receiving end to the name of the form class, that worked, and gives me what I was looking for?
>
>A follow-up question, based on David's response. This approach works so long as the control modifier is either public or internal. If the controls are private/protected, then obviously that won't work.
>
>I understand why, in principle, the use of public/internal modifiers is generally discouraged...however, this seems to be the only way for a 'rules class' to have access to the controls on a form.
>
>Main reason I'm looking to do this, ironically, is to avoid another 'no-no'...significant amounts of business logic code in the same source file as the UI.
>
>The types of things I want to do in this 'rules' class:
>
> - Define grid contents
> - Reading contents of a custom QBE screen and building a WHERE clause
> - Defining bindings for controls
> - Other miscellaneous operations that require examining contents of controls
>
>
>Any additional thoughts?
>
>Thanks,
>Kevin
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform