Declare UserControl in a class

C

Chris Zopers

Hello,

I have a UserControl with the name Toolbox, so the UserControl's class
name is UserControls_Toolbox.

I want to pass this UserControl to a function in another (static) class,
just as you would do with for example a string value:

For example:
string sValue = 'hello';
OtherStaticClass.FunctionName(sValue);

But the problem is that the UserControl's type is unkown in the static
class, so I can't make a function that expects the UserControl as a
parameter.

How can I make something like this:

public void FunctionName(UserControls_Toolbox tb)
{
}

In an aspx page this is not a problem, because in an aspx page I can
declare a variable of type UserControls_Toolbox, but in an other class
this seems not to be possible. Anyone got an idea?

Greetings,
Chris
 
B

bruce barker

define an interface (in appcode) that the user control implements. then you
can pass the interface to the static class

-- bruce (sqlwork.com)
 
G

gnewsgroup

define an interface (in appcode) that the user control implements. then you
can pass the interface to the static class

-- bruce (sqlwork.com)

I am jumping into the conversation. But, why can't we do this shown
below?

UserControls_Toolbox tb
 

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,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top