Evaluate a String that contains code
Is there a way to evaluate a string that contains code. I am wanting to store "Meta Data" in a database and then when the data is read out I want it to be evalulated before the result is rendered. For example lets say I have an onclick event stored in the database. The value of the onclick event is toggle('Car.Engine') where Car.Engine is an accessible object. How can I make the compiler eval the string before it puts the value in the toggle function?
Roei BarPosted Aug 20, 2009, 3:31 AM
either you place add the onclick event on the serverside like
divElement.Attributes.Add("onclick",
or you can use #Eval
on the ClientSide while the #Eval will go to the Property in the server in which you will bring up the value needed
dont forget to mark this as "Accepted Answer" if you liked it