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
Recent Article
- How to decode HTML character code in c#?
- How to save the xml file to a particular location?
- How to use if else statement in c++?
- How to use godaddy domain name with another godaddy hosting account?
- Restore of database 'DATABASE' failed. (Microsoft.SqlServer.Management.RelationalEngineTasks)
- How to programmatically modifying the AppSetting value in web.config using c#?
- TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
- How to calculate the age from jQuery ui datepicker using c#?
Related Article