 <p>Here's a low-tech technique that keeps all the script in your page template: add a <code>$(document).ready()</code> function to the page that executes conditionally based on a page-level variable, like this ...</p> <pre><code>// In your button's click handler, set this.UserHasClicked to true var userHasClicked = '&lt;%= this.UserHasClicked %&gt;' == 'True'; $(document).ready(function() { if(userHasClicked) { $(labelSelector).delay(2000).fadeOut(1000); } }); </code></pre>