c# .net

How to show Message box using asp.net web application?

How to show Message box using asp.net web application?, someone asked me to explain?

Inan asp.net windows forms application we are using in code behind as MessageBox.Show("I am message box"); 

Wecan also make equivalent to that using asp.net web application.

     <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />

     protected void Button1_Click(object sender, EventArgs e)

    {

             string input = "I am message box";

   ClientScript.RegisterStartupScript(this.GetType(), "messagebox", "alert('Message:" + input + "');", true);

     }

 

Output:

           

 

Post your comments / questions