Quote for the Week

"Learn to enjoy every moment of your life"

Thursday, November 27, 2014

Showing Message Box in Asp.net

We don't have predefined function for message box or alert in asp.net web application. It's available only in windows application. But we can create our own method that gives alert functionality. Here the ClientScript used to add the script to the page. so we can get the javascript alert in page.


Page.ClientScript.RegisterStartupScript(this.GetType(), "MessageBox", <your javascript>);

or

ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "Confirm", "Confirm('Text U want to display');", True);

You can define your own script as per your requirement.

No comments: