>string myProps = "FormView1.PageIndex"; >string[] info = myProps.Split('.'); > >Type formType = this.GetType(); >System.Reflection.FieldInfo formInfo = formType.GetField(info[0], System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); >object control = formInfo.GetValue(this); > >Type propertyType = control.GetType(); >System.Reflection.PropertyInfo controlInfo = propertyType.GetProperty(info[1]); >object propertyValue = controlInfo.GetValue(control, null); > >>
>Dim myProps As String = "FormView1.PageIndex" >Dim info As String() = myProps.Split(Microsoft.VisualBasic.ChrW(46)) >Dim formType As Type = Me.GetType() >Dim formInfo As System.Reflection.FieldInfo = formType.GetField(info(0), System.Reflection.BindingFlags.NonPublic Or System.Reflection.BindingFlags.Instance) >Dim control As object = formInfo.GetValue(Me) >Dim propertyType As Type = control.GetType() >Dim controlInfo As System.Reflection.PropertyInfo = propertyType.GetProperty(info(1)) >Dim propertyValue As object = controlInfo.GetValue(control, Nothing) >