title: Registering Javascript block in the codebehind: RegisterClientScriptBlock issue
body: <p><strong>SCENARIO</strong></p>
  
  <p>The BasePage.cs implements System.Web.UI.Page. It is a superclass without aspx from where <strong>all actual pages</strong> are derived.</p>
  
  <p>I am registering some javascript in the BasePage using <a href="http://msdn.microsoft.com/en-us/library/btf44dc9.aspx" rel="nofollow">RegisterClientScriptBlock</a>:</p>
  
  <pre><code>public class BasePage : System.Web.UI.Page
  {
  
    protected virtual void Page_Load(object sender, EventArgs e)
    {
      ClientScriptManager cs = Page.ClientScript;
      Type csType = this.GetType();
      cs.RegisterClientScriptBlock(csType, "handler", @"&lt;script language='javascript' type='text/javascript'&gt;alert('Something stupid!');&lt;/script&gt;");
    }
  }
  </code></pre>
  
  <p>I tested this snippet in a mock: it works right. Then I inserted the snippet in the BasePage.cs. In the index.aspx the script is not executed. Browser debugging shows that:</p>
  
  <ul>
  <li>no script has been registered</li>
  <li>no console error is displayed</li>
  </ul>
  
  <p>In all other pages it works right.</p>
  
  <p><strong>QUESTION</strong></p>
  
  <p>Is there any specific issue related to the <code>RegisterClientScriptBlock()</code> method?</p>
  
  <p><strong>REMARK</strong></p>
  
  <p>I am sorry, but I am not allowed to post the whole index.aspx page code. But maybe if you have a clue then I can give you further details.</p>