I want my asp.net .ascx user control to use some javascript. How to do it properly? I am not sure what I should do? Should I use the scriptmanager object?
ascx'es javascriptscript
227 Views Asked by Bogdan Verbenets At
2
There are 2 best solutions below
0

It depends on the situation. It's perfectly reasonable just to drop the script into your ascx files. This is what I do with simple scripts that don't have any sort of dynamic components. Also good for client-side validatation functions referenced by CustomValidator objects.
For complex scripts it's nice to separate them into their own .js files and link them or add dynamically.
Drop a script manager on the master page and then: