Hi Anthony, What you are after is late binding. There's numerous ways of doing this, such as reflection. But I would probably opt for using CallByName function in VB.
|-----Original Message----- |From: [email protected] [mailto:ozdotnet- |[email protected]] On Behalf Of Anthony |Sent: Saturday, 16 October 2010 12:08 AM |To: 'ozDotNet' |Subject: Assigning property at runtime from database? | |I have a few usercontrols in an asp.net project that have properties set at |runtime from a database. | |Table : ControlProperty | | PropertyName Value | | Name RedControl | | Color Red | | | My asp code | | ....... | | ucHTML = CType(LoadControl("~\Controls\ucHTML.ascx"), |ucHTML) | | for each oProperty in oProperties | | ucHTML.[oProperty. PropertyName ]=[Value] 'What do i do |here? | | ucHTML.Name=Value 'Can't do this as i dont know the property |until runtime! | | Next | | | | I'm sure there is an easy answer to this? | |Is your website being IntelliXperienced? |<http://www.intellixperience.com/signup.aspx> | www.yougoingmyway.com ? |regards |Anthony (*12QWERNB*) | |Is your website being IntelliXperienced? | |
