Sub AutoCreatePropertysControls(ByVal obj As Object)
Dim p As PropertyInfo() = obj.GetType.GetProperties()
For Each pi In p
Dim lt As New Literal
lt.Text = "<li>"
ph.Controls.Add(lt)
Dim pty As String = pi.PropertyType.ToString
Dim lb As Label = New Label
lb.Text = pi.Name
ph.Controls.Add(lb)
lb.Dispose()
If (pi.PropertyType Is GetType(Boolean)) Then
Dim cb As New CheckBox
cb.ID = "tb_" & pi.Name
cb.Checked = pi.GetValue(obj, Nothing)
ph.Controls.Add(cb)
cb.Dispose()
Else
Dim tb As TextBox = New TextBox
tb.ID = "tb_" & pi.Name
tb.Text = pi.GetValue(obj, Nothing)
ph.Controls.Add(tb)
tb.Dispose()
End If
Dim lt2 As New Literal
lt2.Text = "</li>"
Next
End Sub
Dim p As PropertyInfo() = obj.GetType.GetProperties()
For Each pi In p
Dim lt As New Literal
lt.Text = "<li>"
ph.Controls.Add(lt)
Dim pty As String = pi.PropertyType.ToString
Dim lb As Label = New Label
lb.Text = pi.Name
ph.Controls.Add(lb)
lb.Dispose()
If (pi.PropertyType Is GetType(Boolean)) Then
Dim cb As New CheckBox
cb.ID = "tb_" & pi.Name
cb.Checked = pi.GetValue(obj, Nothing)
ph.Controls.Add(cb)
cb.Dispose()
Else
Dim tb As TextBox = New TextBox
tb.ID = "tb_" & pi.Name
tb.Text = pi.GetValue(obj, Nothing)
ph.Controls.Add(tb)
tb.Dispose()
End If
Dim lt2 As New Literal
lt2.Text = "</li>"
Next
End Sub