У меня есть веб-страница.
Я показываю ajaxToolkit:ModalPopupExtender(MPE_Example_Panel_Like_Browser).
Я нажимаю кнопку на ajaxToolkit:ModalPopupExtender(MPE_Example_Panel_Like_Browser), чтобы затем показать другую ajaxToolkit:ModalPopupExtender(MPE_Example_Panel_Like_Browser_Confirmation).
Когда я нажимаю кнопку ОК на втором ajaxToolkit:ModalPopupExtender(MPE_Example_Panel_Like_Browser_Confirmation), я выполняю событие щелчка.
Это затем скрывает второй ajaxToolkit:ModalPopupExtender(MPE_Example_Panel_Like_Browser_Confirmation) и присваивает некоторый текст некоторым меткам.
Проблема в том, что первый ajaxToolkit:ModalPopupExtender(MPE_Example_Panel_Like_Browser) закрывается.
Мне нужен только второй ajaxToolkit:ModalPopupExtender(MPE_Example_Panel_Like_Browser_Confirmation) для закрытия.
Разметка:-
Tests
We are restricted to the Browser Height/Width
This panel acts as an inner browser window.
Modal Popup
Are you sure you want to Save?
Код:-
using AjaxControlToolkit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class WebForm1 : System.Web.UI.Page
{
#region Modal Popup Example Panel Like Browser.
protected void btnMPE_Example_Panel_Like_Browser_Close_Click(object sender, EventArgs e)
{
// DONT SET THE CANCELCONTROLID on the ModalPopupExtender
// Set the CausesValidation = false on btnModal_Popup_No
// for this event to be fired
MPE_Example_Panel_Like_Browser.Hide();
lbModal_Response_Display.Text = "Modal Popup Example Panel Like Browser - Close";
}
protected void btnMPE_Example_Panel_Like_Browser_Save_Click(object sender, EventArgs e)
{
lbMPE_Example_Panel_Like_Browser_Saved.Text = "Save";
MPE_Example_Panel_Like_Browser_Confirmation.Show();
}
#endregion Modal Popup Example Panel Like Browser.
#region Modal Popup Example Panel Like Browser Confirmation.
protected void btnMPE_Example_Panel_Like_Browser_Confirmation_OK_Click(object sender, EventArgs e)
{
MPE_Example_Panel_Like_Browser_Confirmation.Hide();
lbMPE_Example_Panel_Like_Browser_Saved.Text = "Saved";
lbModal_Response_Display.Text = "Modal Popup Example Panel Like Browser Confirmation - OK";
}
protected void btnMPE_Example_Panel_Like_Browser_Confirmation_Cancel_Click(object sender, EventArgs e)
{
MPE_Example_Panel_Like_Browser_Confirmation.Hide();
lbMPE_Example_Panel_Like_Browser_Saved.Text = "Cancel";
lbModal_Response_Display.Text = "Modal Popup Example Panel Like Browser Confirmation - Cancel";
}
#endregion Modal Popup Example Panel Like Browser Confirmation.
}
}
CSS:-
.modalPopup {
background-color: #fff;
border: 3px solid #ccc;
padding: 10px;
width: 300px;
}