Dim txt As New TextBox
Dim type As Type = txt.GetType()
Dim properties() As PropertyInfo = type.GetProperties()
For Each p As PropertyInfo In properties
Response.Write(p.Name & ":" & CStr(p.GetValue(txt, Nothing)))
Response.Write("<br>")
Next
You should read up the documentation on GetProperties, as it accepts a flag-based enumeration that can change the behaviour.
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"GS" <no****@nowhere.com> wrote in message news:OM****************@TK2MSFTNGP09.phx.gbl...
Hi,
What would be c# code to enumarate all properties of object and output them in a form "property name:value"?
Thanks,
GS