PDA

Click to See Complete Forum and Search --> : execute a string


Shevy
Feb 10th, 2005, 01:45 PM
I am developing an asp.net application and i need a command which will do what javascript eval does.
I have a string and i want that string to be the name of a div which i am dynamically creating.
any ideas would be greatly appreciated.
Thanks

dj4uk
Mar 1st, 2005, 09:29 AM
OK if you place a placeholder on your page where the div will be created dynamically. Then use the code below to first create the div (server-side panel control), assign any properties to the panel e.g. ID, width and height etc. and finally add it to the placeholder ControlCollection.


Panel pnlDynamic = new Panel();
pnlDynamic.ID = stringName;
// other panel properties set here

placeholderName.Controls.Add(pnlDynamic);


HTH

DJ