Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: convert string value to control type


Message #1 by "David Adames" <david@p...> on Thu, 8 Aug 2002 02:24:59 -0400
Hi All,

I'd like to get a value from a db table e.g. "Label" or "Textbox", etc. use
it to create a control of that type.  I have tried...

Dim ct As Control 
CType(TypeDescriptor.GetConverter(GetType(Control)).ConvertFromString(rdrFor
mBuild("controltype").ToString), Control)

but that is not correct since I'd like ct to be of type named in my
datatreader field, rdrFormBuild("controltype").  That is, if
rdrFormBuild("controltype") resolves to "Label" then I want my variable to
be of type Label.  Whaddya think?

FYI, my breakpoints are not working so it's really messing up my attempts to
work this out.

David X


  Return to Index