i am using this script in .cs page..
public void messagebox(string msg)
{
Label lbl = new Label();
lbl.Text = "<script language='javascript'>" + Environment.NewLine + "window.alert('" + msg + "')</script>";
Page.Controls.Add(lbl);
}
error as
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).