Thursday, August 26, 2010

How to add a message box in C# Asp.net application ?

In .aspx,

private void MessageBox(string msg)
{
Label lbl = new Label();
lbl.Text = "<script language='javascript'>" + Environment.NewLine + "window.alert('" + msg + "')</script>";
Page.Controls.Add(lbl);
}

and u can call

MessageBox("try again and enter correct key....");

No comments:

Post a Comment