problem adding javascript to control
<p>i am using this script in  .cs page..</p>

<pre><code>public void messagebox(string msg)
{
  Label lbl = new Label();
  lbl.Text = "&lt;script language='javascript'&gt;" + Environment.NewLine + "window.alert('" + msg + "')&lt;/script&gt;";
  Page.Controls.Add(lbl);
}
</code></pre>

<p>error as</p>

<p>The Controls collection cannot be modified because the control contains code blocks (i.e. &lt;% ... %>).</p>
