Is it possible to create a webcontainer control that executes code during design time?

Is it possible to create a webcontainer control that executes code during design time?

I’ll give an example,

I would like to create a webcontainer control that contains a weblabel or other and I would like that as soon as I drag this container onto the webpage, this control executes some code… detecting the last position assigned to the last object inserted on the page and automatically sets its position by increasing the left and the top of the last control inserted

I know the example is very stupid but I hope it makes sense

(to be clear, for the real objective I would like to create a datacontrol and controls associated with it, as there were in vb6, which, once the data source from which to draw from has been set, allows you to list the fields returned by the query or the selected table)

I don’t think there is an easy way to achieve this without the help of 3rd party tools. Graffitisuite has excellent drag and drop support via its GraffitiDrag class which provides drop events where you can do whatever you like. The drop event doesn’t expose the exact position though, maybe you can build your own little grid of dropcontrols to obtain the position.

you won’t be able to execute anything inside the IDE.
you could make an ide script, but it wouldn’t be executed at the dropping of a controlitem
you would have to launch it yourself manually, eventually with a key shorcut.

1 Like