Register client script problem
<p>I'm trying to register this simple script, but i can't get this to show the message.
Any idea why my message won't show??
Using asp.net framework 4.0.
Thanks.</p>

<pre><code>    String csName = "ChangeDivDir";
    Type csType = this.GetType();

    ClientScriptManager cs = Page.ClientScript;

    if (!cs.IsClientScriptBlockRegistered(csType, csName))
    {
        StringBuilder csText = new StringBuilder();
        csText.Append("&lt;script type=\"text/javascript\"&gt;");
        csText.Append(" var oDiv = document.getElementById(\"main\"); ");
        csText.Append(" alert('My message'); ");
        csText.Append("&lt;script&gt;");
        cs.RegisterClientScriptBlock(csType, csName, csText.ToString());
    }
</code></pre>
