Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7920959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:24:22+00:00 2026-06-03T16:24:22+00:00

‘m trying to call a server side function in nested jquery dialogs the design

  • 0

‘m trying to call a server side function in nested jquery dialogs

the design is like this:

[first dialog]

  • clicking a button opens up second dialog
  • clicking another button runs server a side method. (works fine)
  • a gridview gets updated by a server side method.

[second dialog]

  • clicking a button run a server side method
    var btnConfirm = document.getElementById(“<%= BtnAvailEmpAccept.ClientID %>”);
    btnConfirm.click();

[first dialog] works fine as intended, but nothing happens in [second dialog].
[second dialog] javascript code gets executed but never hit the server side method.

Two “div”s for each dialog are enclosed in an updatepanel, since I have gridviews to be updated by button click events.

This is [second dialog]

 $confirmWindow = jQuery("#empConfirmDiv");
                            $confirmWindow.show();
                            $confirmWindow.dialog("open");
                            //instantiate the dialog
                            $confirmWindow.dialog({
                                dialogClass: "empConfirmDialog",
                                maxHeight: 600,
                                width: 1200,
                                resizable: false,
                                modal: true,
                                position: 'center',
                                autoOpen: false,
                                title: 'Exception - Confirmation',
                                overlay: { opacity: 0.5, background: 'black' },
                                buttons: {
                                    "Decline": function () {
                                        var btnDecline = document.getElementById("<%= BtnAvailEmpReject.ClientID %>");
                                        btnDecline.click();

                                    },
                                    "Left Message": function () {
                                        var btnMsg = document.getElementById("<%= BtnAvailEmpMsg.ClientID %>");
                                        btnMsg.click();
                                    },
                                    "Confirm": function () {
                                        var btnConfirm = document.getElementById("<%= BtnAvailEmpAccept.ClientID %>");
                                        btnConfirm.click();
                                    },
                                    "Cancel": function () {
                                        $(this).dialog("close");
                                    }

                                }
                            });

asp:button to run a server side method:

<asp:Button ID="BtnAvailEmpAccept" runat="server" Width="10px" Height="10px" OnClientClick="return SetValidateTrue()"
                            OnClick="BtnAvailEmpAccept_Click" />

Does anyone have ideas why button.Click() does not invoke the server side method?

> Edited: Here is my answer!

    var showDialogConfirmEmp = function () {
        $confirmWindow = jQuery("#empConfirmDiv");
        $confirmWindow.show();
        $confirmWindow.dialog("open");
    }

    var myWindowConfirmEmp =          
        jQuery("#empConfirmDiv").dialog({
            dialogClass: "empConfirmDialog",
            maxHeight: 600,
            width: 1200,
            resizable: false,
            modal: true,
            position: 'center',
            autoOpen: false,
            title: 'Exception - Confirmation',
            overlay: { opacity: 0.5, background: 'black' },
            buttons: {
                "Decline": function () {
                    var btnDecline = document.getElementById("<%= BtnAvailEmpReject.ClientID %>");
                    btnDecline.click();
                },
                "Left Message": function () {
                    var btnMsg = document.getElementById("<%= BtnAvailEmpMsg.ClientID %>");
                    btnMsg.click();
                },
                "Confirm": function () {
                    var btnConfirm = document.getElementById("<%= BtnAvailEmpAccept.ClientID %>");
                    btnConfirm.click();
                },
                "Cancel": function () {
                    $(this).dialog("close");
                }

            }
        });

    var showDialogAvailEmp = function () {
        SetValidateTrue();
        if (IsScheduleWorkChecked()) {
            var button = document.getElementById("<%= btnListEmp.ClientID %>");
            button.click();
            $myWindowAssign = jQuery("#availEmpDiv");
            $myWindowAssign.show();
            $myWindowAssign.dialog("open");
            $myWindowAssign.parent().appendTo(jQuery("form:first"))
        }
        else {
            alert("Please select a work to assign!");
        }

    }
    var myWindowAvailEmp = jQuery("#availEmpDiv").dialog({ maxHeight: 600,
        width: 700,
        resizable: false,
        modal: true,
        position: 'center',
        autoOpen: false,
        title: 'Exception - Available Employees',
        overlay: { opacity: 0.5, background: 'black' },
        buttons: [{
            text: "Proceed",
            "id": "btnProceed",
            click: function () {                        
                Page_IsValid = true;
                if (Page_IsValid) {
                    var btnProceed = document.getElementById("<%= btnProceed.ClientID %>");
                    btnProceed.click();
                }
                $confirmWindow = jQuery("#empConfirmDiv");
                $confirmWindow.show();
                $confirmWindow.dialog("open");
                myWindowConfirmEmp.parent().appendTo(jQuery("form:first"));

            }
        },
            {
                text: "Cancel",
                "id": "btnAvailCancel",
                click: function () {
                    $(this).dialog("close");
                }
            }]
    }); // myWindow


    // JQuery UI: Diaglog
    jQuery(document).ready(function () {

        jQuery("#BtnAssign").click(showDialogAvailEmp);
        //variable to reference window
        myWindowAvailEmp.parent().appendTo(jQuery("form:first"));
        ...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:24:23+00:00Added an answer on June 3, 2026 at 4:24 pm

    I had to add “form:first” :
    “The reason for this is that the dialog function pulls your element and puts it in a window container which are placed outside the Form tag”

    like:

    myDialog.parent().appendTo(jQuery("form:first"));
    

    http://labs.kaliko.com/2011/08/jquery-ui-dialog-aspnet-postback.html
    helped me!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
I've got a string that has curly quotes in it. I'd like to replace
I am trying to create a RegEx expression that will successfully parse the following
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I would like to run a str_replace or preg_replace which looks for certain words
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Hi if i run my project its indicate this logcat error...how to solve this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I need a function that will clean a strings' special characters. I do NOT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.