N
netnet
I have a asp.net page with a method to track down a dynamic control....
private void findAndSetTheControl(Control theControl, object theType, string
nameOfControl)
{
theControl = (theType)(PH.FindControl(nameOfControl));
}
It gets called here and a couple of other places:
public void findAndSetThePaymentControl()
{
findAndSetTheControl(thePaymentControl, PaymentControl,
nameOfPaymentControl);
}
What I would like to do is dynamically type (theType) it at runtime. Is
this possible without using some sort of abstract class and doing the
kabookie dance? I know that GetType() wiill return the objects type but im
not really sure how to use it at runtime.
Thanks in advance for the feedback.
Sean
private void findAndSetTheControl(Control theControl, object theType, string
nameOfControl)
{
theControl = (theType)(PH.FindControl(nameOfControl));
}
It gets called here and a couple of other places:
public void findAndSetThePaymentControl()
{
findAndSetTheControl(thePaymentControl, PaymentControl,
nameOfPaymentControl);
}
What I would like to do is dynamically type (theType) it at runtime. Is
this possible without using some sort of abstract class and doing the
kabookie dance? I know that GetType() wiill return the objects type but im
not really sure how to use it at runtime.
Thanks in advance for the feedback.
Sean