locked
Confirmbox Control with ModalPopupExtender: How to invoke a code-behind procedure call from the user control RRS feed

  • Question

  • User-1334136856 posted

    Perhaps I have become to complicated in my thinking about the problem:

    I have created a Confirmbox Control with ModalPopupExtender in a ascx file. It is created in this way

    <Msg:PopUpConfirm ID="PopupConfirm1" runat="server" />

    and used in the following way

                    if (iResult == 0)
                    {
                        PopupConfirm1.Message = "Shall the delivery be completed?";
                        PopupConfirm1.ShowPopUp();
                    }
    

    The Popup has an asp Yes and No button. How can I invoke a code-behind procedure call from the Yes-button to the page on which the PopupConfirm-control is created. Is it possible to define a function call delegate to the PopupConfirm1 or something like this?

    Somebody can help?


    Monday, June 11, 2012 9:27 AM

Answers

  • User-1334136856 posted

    I found the following article on codeproject

    http://www.codeproject.com/Articles/42456/ModalPopupExtender-to-Show-a-MessageBox?msg=4278164#xx4278164xx

    which answered my questions.

    What I needed, is the technique of adding events, so that I am able to continue in my page that calls the modal popup after pressing YES or NO.

    The project example there continues in default.aspx

        void omb_OkButtonPressed(object sender, EventArgs args)
        {
            lblStatus.Text = "Ok button pressed at: " + DateTime.Now.ToLongTimeString();
        }

    and already a button OK1 is prepared in the project, which can be changed quite easily into a NO or CANCEL button.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 12, 2012 4:50 AM

All replies

  • User3866881 posted

    How can I invoke a code-behind procedure call from the Yes-button to the page on which the PopupConfirm-control is created. Is it possible to define a function call delegate to the PopupConfirm1 or something like this?

    Isn't this?

    if (iResult == 0)
                    {
                        PopupConfirm1.Message = "Shall the delivery be completed?";
                        PopupConfirm1.ShowPopUp();
                    }

    If not,please show us how you did to create the customized control?

    Tuesday, June 12, 2012 1:59 AM
  • User-1334136856 posted

    I found the following article on codeproject

    http://www.codeproject.com/Articles/42456/ModalPopupExtender-to-Show-a-MessageBox?msg=4278164#xx4278164xx

    which answered my questions.

    What I needed, is the technique of adding events, so that I am able to continue in my page that calls the modal popup after pressing YES or NO.

    The project example there continues in default.aspx

        void omb_OkButtonPressed(object sender, EventArgs args)
        {
            lblStatus.Text = "Ok button pressed at: " + DateTime.Now.ToLongTimeString();
        }

    and already a button OK1 is prepared in the project, which can be changed quite easily into a NO or CANCEL button.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 12, 2012 4:50 AM