1. Run in ScriptManager
This is the best way to implement the java_script into code behind of asp.net. This can run when we want functionality.
This is not a perfect way. When we add to button, which trigger, after the button click. That mean is you must click twice that button and you can't change that functionality in direct.