Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change property by variable

Status
Not open for further replies.

raphael232

Programmer
Jun 9, 2006
51
GB
Hi, i want to change a property of an object by a variable name ie say i have:

'usual way of doing things
document.title = "Document Title"
document.description = "Description of document"

and i have

' what i need to do
Dim column As String = "keywords"
document.column = "Keywords of document"

Therefore i am getting the properties name based on the value stored in the column variable. The problem i have is that the above does nork as it looks for column as a property of the object instead of looking for keywords as a property.

Appreciate if someone could help. Thanks
 
Have a look into System.Reflection


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Hi cheers for replying but you've lost me a bit. I tried googling system.reflection but i don't understand it. Forgot to mention that i'm abit of newbie when it comes to asp.net.
 
If you have a look at the help files ( you'll see that it says:
The System.Reflection namespace contains types that retrieve information about assemblies, modules, members, parameters, and other entities in managed code by examining their metadata
so you can use this namespace to "examine" a class or object.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top