Wednesday, March 21, 2012

Passing a reference to a User Control to a class in ASP2.0

Hi:

I'm trying to pass a reference to a user control to a class. The user
control exposes its elements via properties. When I inspect parameter (user
control is passed to class using "this") I can see it's data in debugger,
but no way to access it in class code. I have tried casting to control
type, but it says type or namespace can't be found. Any ideas?

Charliedefine a base class the control inherits from that defines the properties,
or better yet, have the control implement an interface with the desired
properties, then cast the control to the interface in the class.

-- bruce (sqlwork.com)

"Charlie@.CBFC" <fineblumcb@.verizon.net> wrote in message
news:Oq3%23puwXGHA.5012@.TK2MSFTNGP05.phx.gbl...
> Hi:
> I'm trying to pass a reference to a user control to a class. The user
> control exposes its elements via properties. When I inspect parameter
> (user control is passed to class using "this") I can see it's data in
> debugger, but no way to access it in class code. I have tried casting to
> control type, but it says type or namespace can't be found. Any ideas?
> Charlie

0 comments:

Post a Comment