Click here to Skip to main content
15,896,207 members
Articles / Web Development / ASP.NET

ASP.NET Popup Control Displaying as multiple nested modal popups

Rate me:
Please Sign up or sign in to vote.
4.89/5 (11 votes)
26 Apr 2013CPOL3 min read 55.3K   2.5K   31  
This article describes using web modelpop extender as Windows model popup dialogbox.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace nested_model_popup_dialog
{
    public partial class anypage : System.Web.UI.Page
    {
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            //you can Dynamically assigned like this
            //ModelPopupRelation1.ParentModelPopupID = "mpeFirstDialogBox";
            //ModelPopupRelation1.ChildModelPopupID =  "mpeSecondDialogBox";
            //ModelPopupRelation1.Start = true;
        }
         
        /// <summary>
        /// Handles the Click event of the btnOpenFirstDialogBox control.handels event for the first DialogBox
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void btnOpenFirstDialogBox_Click(object sender, EventArgs e)
        {
            mpeFirstDialogBox.Show();//opens the first dialogbox
        }
        
        /// <summary>
        /// Handles the Click event of the btnOpenSecondDialogBox control.handels event for the second DialogBox
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void btnOpenSecondDialogBox_Click(object sender, EventArgs e)
        {
            mpeFirstDialogBox.Show();//opens the first dialogbox
            mpeSecondDialogBox.Show();//opens the second dialogbox
          
        }
    }
}

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)


Written By
Software Developer
India India
I'm a software engineer living in Jaipur.I have been designing and developing business solutions for the Insurance and Education industries since 2007.I like to learn new technologies and make them easier for all.

Comments and Discussions