Click here to Skip to main content
12,360,613 members (57,761 online)
Click here to Skip to main content
Articles » Web Development » ASP.NET » Samples » Downloads

Stats

121.6K views
7.2K downloads
109 bookmarked
Posted

AJAX Enabled MessageBox

, 14 Sep 2009 CPOL
MessageBox usercontrol that is AJAX ready and has confirmation support
YaBu.MessageBox
AjaxControlToolkit.dll
App_Data
App_Themes
default
mpImgs
att.png
err.png
inf.png
suc.png
bin
AjaxControlToolkit.dll
YaBu.MessageBox.dll
YaBu.MessageBox.pdb
MessageBoxUsc
Properties
YaBu.MessageBox.csproj.user
YaBu.MessageBox.suo
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace YaBu_MessageBox
{
    public partial class _Default : System.Web.UI.Page
    {
       
        protected void btnInfo_Click(object sender, EventArgs e)
        {
            uscMsgBox1.AddMessage("The user saved successfully but should be activated by an administrator within 3 days.", YaBu.MessageBox.uscMsgBox.enmMessageType.Info);
        }

        protected void btnError_Click(object sender, EventArgs e)
        {
            uscMsgBox1.AddMessage("Unknown error occured. Please try again later.", YaBu.MessageBox.uscMsgBox.enmMessageType.Error);
        }

        protected void btnAttention_Click(object sender, EventArgs e)
        {
            uscMsgBox1.AddMessage("You must enter the user name.", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention);
        }

        protected void btnSuccess_Click(object sender, EventArgs e)
        {
            uscMsgBox1.AddMessage("The user saved successfully.", YaBu.MessageBox.uscMsgBox.enmMessageType.Success);
        }

        protected void btnMultiple_Click(object sender, EventArgs e)
        {
            uscMsgBox1.AddMessage("The user saved successfully.", YaBu.MessageBox.uscMsgBox.enmMessageType.Success);
            uscMsgBox1.AddMessage("The newly saved user account should be activated by an administrator within 3 days", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention);

        }

        protected void Page_Load(object sender, EventArgs e)
        {
            uscMsgBox1.MsgBoxAnswered += MessageAnswered;
        }

        protected void btnConfirm_Click(object sender, EventArgs e)
        {
            uscMsgBox1.AddMessage("Do you confirm to save a new user?.", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention, true, true, txtArg.Text);
        }

        public void MessageAnswered(object sender, YaBu.MessageBox.uscMsgBox.MsgBoxEventArgs e)
        {
            if (e.Answer == YaBu.MessageBox.uscMsgBox.enmAnswer.OK)
            {
                uscMsgBox1.AddMessage("You have just confirmed the transaction. The user saved successfully. You have entered " + txtArg.Text + " as argument.", YaBu.MessageBox.uscMsgBox.enmMessageType.Info);
            }
            else
            {
                uscMsgBox1.AddMessage("You have just cancelled the transaction.", YaBu.MessageBox.uscMsgBox.enmMessageType.Info);
            }
        }
    }
}

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Yavuz Küçükpetek
Software Developer (Senior) NetCad
Turkey Turkey
Yavuz is a software developer since 2001 and working as senior software developer at NetCad in Ankara, Turkey.

He has experience in mostly Microsoft technologies such as ASP.Net, SQL Server, C#, VB.Net, WPF, WCF etc. and especially interested in security and performance issues.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160621.1 | Last Updated 15 Sep 2009
Article Copyright 2009 by Yavuz Küçükpetek
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid