Loading a control from it's type

Q

questions

Can anyone offer any advice or point me in a direction of help.

I would like to be able to load a give webcontrol, say a TextBox from
it's type (which would be stored in either XML or SQL).

For example,

TextBox =
"System.Web.UI.WebControls.TextBox, System.Web, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

Thank you

Tony
 
K

Karl Seguin

dim type as Type =Type.GetType("YOUR STRING")
if not type is nothing then
dim txt as TextBox = ctype(Activator.CreateInstance(type), Type)
end if


Karl
 

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

Top