Thursday, February 9, 2012

Create a Message Box in ASP.NET using C#

public void MsgBox1(string msg, Page refP)
{
Label lbl = new Label();
string lb = "window.alert('" + msg + "')";
ScriptManager.RegisterClientScriptBlock(refP, this.GetType(), "UniqueKey", lb, true);
refP.Controls.Add(lbl);
}

Function Call:

MsgBox1("Your Message", this);

No comments:

Post a Comment