ASP.NET RegisterClientScriptBlock, RegsiterStartupScript issues
<p>I am working on a set of ASP.NET applications using a master page.
When I try to register a clientscript - an alert box for instance, in the Page_Load it works fine. However if I try to do the same from any method or event handler of the same class it doesn't.
Also, it doesn't seem to matter which Register method you use, both work only in the Page_Load (for me).</p>

<p>I could not find another way so far to alert the user about exceptions and such from within the code (other than building a user control) and I figure in a similar situation other JavaScript codes won't execute either...for example one that would refresh an iframe content.</p>

<p>I'm wondering if there is a best practice to achieve a little more dinamic interaction between JavaScript and code behind?</p>

<p>What I mean is something that:</p>

<ul>
<li>can be called from anywhere in the codebehind</li>
<li>UpdatePanels and MasterPages don't make it unreliable</li>
</ul>
