In this article you can find some frequently asked questions and its answers about User Controls.
No, Genexus.exe /install should only be executed when making changes to the UC structure, that is, when changing its properties or events.
In order to get the container name at runtime you can use "this.ContainerName" inside the control's scope. E.g: var name = this.ContainerName;
In order to get a reference to the container control, you can use "this.getContainerControl()" inside the control's scope. E.g: var name = this.getContainerControl();
In many cases your user control will have to generate html like this: <a href="www.genexus.com" onclick="someFunction(z)">text</a>. In those cases you will want the onclick event to be attended by a function of your user control and not a global function (because that would be a problem if you have multiple instances of you control in the same web page). In those cases you will have to use the "this.me()" function within the scope of your user control as follows:
<a href="'+ this.MenuData[i].MenuURL + '" onclick="' + this.me() + '.JSDolphinItemClicked(\'' + this.ControlName + '\',' + i +');" title="' + this.MenuData[i].MenuDescription + '"> + this.MenuData[i].MenuTitle + '</a>
The example above is taken from the Dolphin Style Menu user control, downloadable here.
Use "this.IsPostback" to detect if the control is being loaded for the first time or not. E.g.:
this.show = function()
// draw control
The recommended way of subscribing user controls functions to the onload event is using: