You can use ClientScriptManager.RegisterStartupScript() , for example:
var script = "$(function() { $('#message').fadeIn(); });"; Page.ClientScript.RegisterStartupScript(GetType(), "keyHere", script, true);
This is displayed on the page as follows:
<script type="text/javascript"> $(function() { $('#message').fadeIn(); }); </script>
A script is just any JavaScript, nothing special in jQuery, just enter everything you manually placed on the page there, as it ends.
source share