I Trying to Create Instance by Using String name i.e a class name bt GetType method returns null
namespace DocSys
{
public class Documents
{
Control ctlControl = new Control();
//strProgID= DocCtl.Button
Type type = Type.GetType(strProgID); // null Value in Type type
ctlControl = (Control)Activator.CreateInstance(t);
}
}
At present strProgID contains DocCtl.Button (Button is a user control and it namespace is DocCtl)
Can i create a object of strProgID
in-order to get that type from tha string you need to use the fully qualified name of that type , should be something like
DocCtl.Button,AssemblyThatContainsThisNamespace