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 6874145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:09:29+00:00 2026-05-27T04:09:29+00:00

I have an MVC3 application doing AJAX edit of a grid line using JQUERY

  • 0

I have an MVC3 application doing AJAX edit of a grid line using JQUERY popup dialog and then immediately refreshing the grid using another Ajax call.
Please see below the JQuery part.I want to have a single function to popup edit entities like phone# and emails and wanted to standardize hence the dynamic Dialog.

Now the popup works and the update/create and grid refresh work correctly. However I have recurring issues with the Popup displaying older values and while investigating I found the lines

  success: function (r) {
                $("#" + listEditElement).html(r.data);
                alert("Grid done");
                $("#" + resultElement).dialog('close');
            },

to be causing the problem.If I remove $("#" + listEditElement).html(r.data); whic is populating the Grid using ajax return data the issue of displaying older values in Popup disappers. Another oddity is that the Popup is not closed by the ‘Close’ call. However if I move the ‘Close’ call to before the .html() line the dialog closes successfully.
Any clues what I could be doing wrong ?

function openPopup(elementId, popupFormName) {
    $("#" + elementId).dialog({
        autoOpen: false,
        title: 'Title',
        title: $("#" + elementId).attr('title'),
        width: 500,
        cache: 'false',
        height: 'auto',
        modal: true,
        buttons: {
            "Save": function () {
                $("#update-message").html('hhhhhhhhhhhhhhha'); //make sure there is nothing on the message before we continue                         
                $("#" + popupFormName).submit();
            },
            "Cancel": function () {
                $(this).dialog("close");
            }
        }
    });
    $("#" + elementId).dialog("open");
    return false;
}

function closePopup(resultElement, listEditElement, actionURL) {

    //   var itemId = element.attr("data-tododb-itemid");

    var d = null;

    //      $("#ajax-progress-dialog").dialog("open");

    $.ajax({
        type: "POST",
        url: actionURL,
        data: d,
        success: function (r) {
            $("#" + listEditElement).html(r.data);
            alert("Grid done");
            $("#" + resultElement).dialog('close');
        },
        complete: function () {
            $("#ajax-progress-dialog").dialog("close");
            $("#" + resultElement).dialog("destroy");
        },
        error: function (req, status, error) {
            //do what you need to do here if an error occurs

        }
    });
  • 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-27T04:09:30+00:00Added an answer on May 27, 2026 at 4:09 am

    Sounds to me like the line

      $("#" + listEditElement).html(r.data);
    

    Was failing (eg r.data was not valid html) and throwing an error thus

     $("#" + resultElement).dialog('close');
    

    Was never getting called.

    You could wrap it in a try/catch to see if that stops it from not running the close line.

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

Sidebar

Related Questions

I am developing an MVC3 application using Visual Studio 2010. I have an aspx
I have an MVC3 application using NHibernate. I've created my own membership and role
I am currently creating an MVC3 application using Ninject. I have two controllers which
I'm learning ASP.NET MVC3 and doing an application with CMS capabilities - but have
I have the following dropdown list in an MVC3 application and the selected item
I'm currently using Unity with Unity.Mvc3 in my MVC3 application which uses Windows Authentication.
I am using MVC3, and have some logic for changing the culture which all
I have an ASP.NET MVC 3 (using Entity Framework 4.2) application that uses transactions
I'm using DataAnnotations to validate my input fields on a MVC3 application. I'm using
I have MVC3 web application where we need to populate radio button list with

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.