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

  • SEARCH
  • Home
  • 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 6169995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:57:20+00:00 2026-05-23T22:57:20+00:00

i call my UI dialog from page which has scriptManager, this way: function openDialog()

  • 0

i call my UI dialog from page which has scriptManager, this way:

function openDialog() {

     var $dialog = jQuery('#dialog');   
     $dialog.load('dialog.aspx');
     $dialog.dialog({
        autoOpen: false,
        title: 'Add New Contact Personel',
        modal: true,
        height: 200,
        width: 400,
        show: 'puff',
        hide: 'puff',
        close: function (event, ui) {
            $dialog.html('');
            $dialog.dialog('destroy');
        }
     });
    $dialog.dialog('open');
}

body of dialog.aspx looks like this:

<body>
    <form id="form1" runat="server">
<%--    <asp:ScriptManagerProxy ID="proxyScriptor" runat="server"></asp:ScriptManagerProxy>
    <asp:UpdatePanel ID="upadatePanel" runat="server" UpdateMode="Conditional">
    <ContentTemplate>--%>

    <div>

        <table border="0">
            <tr>
                <th>SomeText:</th>
                <th><asp:TextBox ID="someTextBox" runat="server"></asp:TextBox></th>
            </tr>

        </table>
    </div>


    <asp:Panel ID="updatePanel" runat="server">
        <asp:Button ID="UpdateLoger" runat="server" Text="Update" onclick="Update_Click" />
    </asp:Panel>

<%--    </ContentTemplate>
    </asp:UpdatePanel>--%>


    </form>
</body>

now: if i click updateBtn i want to update text in postback, close UI dialog and do refresh like this:

UpdateText(someTextBox.Text);
            string script = @"jQuery('#dialog').html('');jQuery('#dialog').dialog('destroy');window.location.reload()";
            ScriptManager.RegisterClientScriptBlock(this, typeof(UpdatePanel), "jscript", script, true);

so if add another script manager on this page for UI dialog, very very wird things have happend (like __doPostBack doesn’t work), if i remove scriptManager, updatePanel doesnt show it contents, if i put scriptMangerProxy , updatePanel doesn’t show it contents either. So how i should do it?

  • 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-05-23T22:57:20+00:00Added an answer on May 23, 2026 at 10:57 pm

    You’ve got a lot going on here. One problem you’re running into is that you’re treating dialog.aspx like it’s loading into it’s own window or iframe. In reality, its just being inserted as a document fragment into the page’s DOM. I suspect if you inspect the source, you’ll find multiple <body> tags.

    There’s several ways of doing this. My dialogs are typically unique to a particular page, so I’ll handle the dialog somewhat like this:

    Page.aspx

    <html>
    <head>...</head>
    <body>
        <!-- page content -->
    
        <asp:Button ID="btnOpenDialog" runat="server" OnClick="btnOpenDialogClick" Text="Open Dialog" />
    
        <asp:UpdatePanel ID="upDialogs" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
    
        <asp:Panel ID="pnlDialog" runat="server" CssClass="pnlDialog" Visible="false">
            <!-- Dialog form -->
            <asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmitClick" Text="Submit" />
        </asp:Panel>
    
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostbackTrigger ControlID="btnOpenDialog" />
        </Triggers>
        </asp:UpdatePanel>
    
        <script>
    
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function() {
    
    
           $("div.pnlDialog").dialog({
              autoOpen: true,
              title: 'Add New Contact Personel',
              modal: true,
              height: 200,
              width: 400,
              show: 'puff',
              hide: 'puff',
              close: function (event, ui) {
                 $dialog.html('');
                 $dialog.dialog('destroy');
              }
           });
    
        }
    
        </script>
    
    </body>
    </html>
    

    Page.aspx.cs

    ...
    protected void btnOpenDialogClick(object sender, EventArgs e)
    {
        pnlDialog.Visible = true;
        upDialogs.Update();
    }
    
    protected void btnSubmitClick(object sender, EventArgs e)
    {
        ... save values ...
        pnlDialog.Visible = false;
        upDialogs.Update();
    }
    ...
    

    Basically, we register a JS function to fire every time the page performs an asynchronous postback. This functions looks for the dialog box code. If it finds it, it wires it up with jQueryUI. If it doesn’t find anything, it just finishes silently. If you have multiple dialogs on the page, this can easily be refactored to flexibly handle them.

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

Sidebar

Related Questions

My aspx page:- <script src=js/jquery-1.4.2.js type=text/javascript></script> <script src=js/jquery-ui-1.8.2.custom.js type=text/javascript></script> <script type=text/javascript> $(document).ready(function () {
Does anybody know how to call the import data built-in dialog excel from a
I want to call a function from a .NET DLL (coded in C#) from
I'm trying to call a function after I load some XML into Actionscript, and
I want to show a popup screen on my page using JQuery UI Dialog
Is there a way in which I can save details from a ListView that
I call my JavaScript function. Why do I sometimes get the error 'myFunction is
How do I call shell commands from inside of a Ruby program? How do
If I call finalize() on an object from my program code, will the JVM
How do I call a function, using a string with the function's name? For

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.