Hello Derek,
I guess this greatly depends on the control you are using.
Different controls will allow different way of interaction.
If you want to register a JavaScript file in the Head element of the HTML you need override the pre-render method event handler modify the HTML of the response and call base.
Regards,
Ori Cohen
Support Manager, the Visual WebGui team