title: ASP.net: ClientScript.RegisterClientScriptBlock fires before jQuery is loaded
body: <p>Interesting problem here from some inherited code I recently looked at. I'm trying to add a compression module to a project. It is loading all the JS and CSS files, combining them, minifying them, and compressing them. I've tried a number of solutions, but all of them have one fatal problem.</p>
  
  <p>I have some javascript that is being loaded via Page.ClientScript.RegisterClientScriptBlock in the PreRender of the MasterPage. The compression module is loading as a Script Tag link in the MasterPage, but when I run the page... the code from the PreRender is lopped on top and is giving me a '$ is undefined' error, telling me jQuery isn't loaded yet. </p>
  
  <p>Furthermore, I can't seem to get past the same problem when it comes to inline javascript on content pages. </p>
  
  <p>Any ideas as to what is causing this? Enlighten me as I have no clue.</p>