Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 4th, 2012  |  syntax: None  |  size: 0.51 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Dynamically Reference an Object Property Using a String
  2. Dim tmpValue As String
  3. Dim ucAppName As UserControl_appName = CType(Parent.FindControl(strucParam(i).ParentFindControl), UserControl_appName)
  4.  
  5. tmpValue = ucAppName.FirstName.Text
  6.        
  7. tmpValue = objObject.GetType().GetProperty(strPropertyName).GetValue(objObject, Nothing)
  8.        
  9. Dim textBox as TextBox
  10. Dim tmpValue as String
  11.  
  12. textBox = CType(ucAppName.GetType().GetProperty(strucParam(1).PropertyName).GetValue(objAppNav, Nothing), TextBox)
  13. tmpValue = textBox.Text