Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear All,

I have created on Employee project using SQL Server 2008 R2.

I have a got an error when loading the page like,

The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.

Is there any error using MessageBox

XML
private void MessageBox(string Message)
    {
        Label lblMessageBox = new Label();

        lblMessageBox.Text = "<script language='javascript'>" + Environment.NewLine + "window.alert('" + Message + "')</script>";
        Page.Controls.Add(lblMessageBox);
    }


Note: No.of times I have used MessageBox("alert message."); for alert messages

Please tell me solution. Thanks in advanced.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900