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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:43:02+00:00 2026-06-09T16:43:02+00:00

I have a quick edit jquery dialog that allows my users to change some

  • 0

I have a quick edit jquery dialog that allows my users to change some customer details. The form is great, but after the form submit I cant work out how to get the modal dialog to close and return back to the view still in the background.

my http post on quickedit performs all of the database updates etc, but currently only returns a partial view of the quickedit form. I need it to either close the modal and return back to the page that called the dialog (without reloading it…) or just drop back to the modal dialog if that isn’t possible.

here is my http post code:

        [HttpPost, ActionName("QuickEdit")]
    public ActionResult QuickEdit(newUser usrdet)
    {
        db.Entry(usrdet).State = EntityState.Modified;
        db.SaveChanges();
        return PartialView(usrdet);
    }

The code as it is returns back the updated object, but not in a jquery UI modal..

Any help greatly appreciated.

Javascript to invoke the ui:

<script type="text/javascript">
$.ajaxSetup({ cache: false });

$(document).ready(function () {
    $(".openDialog").live("click", function (e) {
        e.preventDefault();
        $("<div></div>")
  .addClass("dialog")
  .attr("id", $(this).attr("dialog-id"))
  .appendTo("body")
  .dialog({
      title: $(this).attr("dialog-title"),
      close: function () { $(this).remove() },
      modal: true,
      width: 706,
      height: 600
  })
  .load(this.href);
    });

    $(".close").live("click", function (e) {
        e.preventDefault();
        $(this).closest(".dialog").dialog("close");
    });
});

  • 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-09T16:43:03+00:00Added an answer on June 9, 2026 at 4:43 pm

    In case the data was valid and you could save the edits, i would return a new partial view which just contains some javascript code to close the dialog like this:

    [HttpPost, ActionName("QuickEdit")]
    public ActionResult QuickEdit(newUser usrdet)
    {
        if (ModelState.IsValid) {
            db.Entry(usrdet).State = EntityState.Modified;
            db.SaveChanges();
            return PartialView("CloseDialog");
        }
        return PartialView(usrdet);
    }
    

    And the partial view CloseDialog:

    <script type="text/javascript">
        $(".dialog").dialog("close");
    </script>
    

    You can customize the action/view to pass in the id of the dialogs html element or just rely on the css class dialog like in my example.

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

Sidebar

Related Questions

Hey guys I have a quick question, I have a dialog box that has
I have some AJAX work that brings across an additional form element that I
some of our customers have Quick book online and some of our customers have
I have a quick question that I can't seem to find online. I am
I have this quick question, i have got the username variable from a form
I have no experience with jquery or javascript for that matter. I am trying
I have a quick question regarding memory management that I am not quite sure
Just a quick question... I currently have the following jQuery code with a selector
I have some quick questions on windows dll. Basically I am using the ifdefs
I have been looking for a really good, well documented jquery plug-in that will

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.