Tuesday, July 26, 2011

Message Box in ASP.NET







To display message box, just declare this function,


protected void MessageBox(string message)

{

string sJavaScript = "<script language=javascript>\n";

sJavaScript += "alert('" + message + "');\n";

sJavaScript += "</script>";

this.RegisterStartupScript("MessageBox", sJavaScript);

}

and call this function and provide the string value you want to display.


MessageBox("Horray ! I got my Message Box");

Arun Kumar Munusamy
Arun Kumar Munusamy Web Developer

Morbi aliquam fringilla nisl. Pellentesque eleifend condimentum tellus, vel vulputate tortor malesuada sit amet. Aliquam vel vestibulum metus. Aenean ut mi aucto.

No comments:

Post a Comment