Thanks for replies,
I can't use typeof(Class1) or something similar,
because I don't know the string, and "Class1" is just an example.
I'll explain more,
There are lots of classes in business layer, they behave same and are
inherited from one base class.
There is a WebForm that users load it through menus, and the
classname given in QueryString.
Now we have something like it in the WebForm:
BaseClass baseclass;
string q=Request.QueryString["classname"];
switch (q)
{
case "ClassX":
BaseClass=new ClassX();break;
case "ClassY":
BaseClass=new ClassY();break;
case "ClassZ":
BaseClass=new ClassZ();break;
}
grid.DataSource=BaseClass().GetBrowsableData();
I want to get rid of this switch case statement, because the programmers
in our team want to add many classes.
In this situation, for each class they've to add a switch case and checkouts
and checkins and waitings!
So, it seems there is "no" way to do that in a WebSite. Right?