Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Server Side MessageBox

, 19 Sep 2005
A web (modal) messagebox without popup.
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page 
    protected void Page_Load(object sender, EventArgs e)
        Mbox1.Btn1Clicked += new EventHandler(Mbox1_Btn1Clicked);
        Mbox1.Btn2Clicked += new EventHandler(Mbox1_Btn2Clicked);

    void Mbox1_Btn2Clicked(object sender, EventArgs e)
        Response.Write("2nd button clicked");

    void Mbox1_Btn1Clicked(object sender, EventArgs e)
        Response.Write("1st button clicked");

    protected void Button1_Click(object sender, EventArgs e)
        Mbox1.Show("hede", "hod");
    protected void Button2_Click(object sender, EventArgs e)
        Mbox1.Show("My test message", "Warning", "OK", "Cancel", null);
    protected void Button3_Click(object sender, EventArgs e)
        Mbox1.Show("My test message", "Warning", "OK", "Cancel", null,msg.MessageBoxIcons.Exclamation);
    protected void Button4_Click(object sender, EventArgs e)
        Mbox1.Show("My test message", "Warning", "OK", "Cancel", "Retry", msg.MessageBoxIcons.Exclamation,msg.MessageBoxStyle.Violet );

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Kivanc Ozuolmez
Software Developer
Netherlands Netherlands
No Biography provided

| Advertise | Privacy | Mobile
Web04 | 2.8.140814.1 | Last Updated 19 Sep 2005
Article Copyright 2005 by Kivanc Ozuolmez
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid