Given the class:
public class Foo { public string Name { get; set; } }
Is it possible to have a Foo instance created from a string thro
object value1 = "one"; Foo value2 = (Foo) System.Convert.ChangeType(value, typeof(Foo));
object value1 = "one";
Foo value2 = (Foo) System.Convert.ChangeType(value, typeof(Foo));
Edit:
Ok then, if you are trying to create type of Foo from string, you could use reflection:
String controlToCreate = "Foo"; Type typeofControl = Type.GetType(controlToCreate,true);