Groups | Blog | Home
all groups > asp.net webcontrols > december 2007 >

asp.net webcontrols : Is any way to palce a control(button/label) at a location on a panel in a webPage ASP.net 2.0in runtime??


chandan
12/5/2007 10:08:56 PM
Hi,
Is any way to palce a control(button/label) at a location on a panel
in a webPage in runtime??



I am trying to place a control at mouse click position on the a panel
in a
page.also I am not getting the mouse down position on the panel ,I am
working on that.Actually I am windows Programmer and all those things
are done in windows very smoothly.


Let me know if any solution!! send me some link for sample for this
problem


Cheers,
Chandan Kumar
John Padilla
12/15/2007 12:31:01 PM
There sure is.

you need to decide when you want to add something to the panel (an event)

insid the event you do this:

say your panel's ID = myPanel

string[] count = new string[2];
count[0] = "btOne";
count[1] = "btTwo";

myPanel.Controls.Add((new TextBox()).ID = count[0]);
myPanel.Controls.Add((new TextBox()).ID = count[1])

You can add any type of control at run time this way that you can do at
designtime.

Hope this helps!
[quoted text, click to view]
AddThis Social Bookmark Button