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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:58:17+00:00 2026-06-18T05:58:17+00:00

I am using a dialog box as such: <div id=dialog title=Edit Information style=overflow: hidden;>

  • 0

I am using a dialog box as such:

    <div id="dialog" title="Edit Information" style="overflow: hidden;">
    </div>


    $('#dialog').load("@Url.Action("EditInfo")",
                    function(response, status, xhr) {
                        $('#dialog').dialog('open');
    });

Once the user user clicks on submit in the dialog box I got to httppost as such

     [HttpPost]
     public ActionResult EditInfo(MicroInfo model)
     {
        if (ModelState.IsValid)
        {
            lbService.EditMicroInfoData(model);
            return View(model); // success 
        }

        return View(model); // problem           

     }

When it goes to

    return View(model) // success

, it does not goes not open in the dialog box but in a normal page. I like to open it back in the dialog box so the user can close the dialog box.

I am wondering if I should do this in a

      $.ajax( .... 

call

  • 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-18T05:58:19+00:00Added an answer on June 18, 2026 at 5:58 am

    You could use an Ajax.BeginForm inside the partial that you are loading. So put the contents that you want to be loaded in the dialog inside a partial and also have your HttpPost controller action return this same partial view instead of returning an entire view.

    Don’t forget to include the jquery.unobtrusive-ajax.js script to your page if you want the Ajax.BeginForm form to work.

    As an alternative to using Ajax.BeginForm you could still use a normal Html.BeginForm and manually AJAXify it:

    $(document).on('submit', '#dialog form', function() {
        $.ajax({
            url: this.action,
            type: this.method,
            data: $(this).serialize(),
            success: function(result) {
                // Here you could test the result of the controller action
                // and in case it is success close the modal
                // I would recommend you returning a Json result in this case
                // so that here you could test for it:
                if (result.success) {
                    $('#dialog').dialog('close');
                } else {
                    // a partial view was returned, probably an error =>
                     // refresh the dialog
                    $('#dialog').html(result);
                }
            }  
        });
        return false;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Simple Dialog 2 : I have the dialog box below: $('<div>').simpledialog2({ mode:
I am added div content into the dialog box using jquery.I am using the
I am using Jquery Dialog box for a cv registration form on my website
I am using a dialog box to display and submit a enquiry form on
How to prompt browser to display open/save dialog box using jquery?
I'm using the jquery-ui dialog box . My problem is upon clicking the x
Using 8.5.3 UP1 When I save my document from a dialog box certain fields
I am using the following code to open a dialog box: <li> <input type=button
Is there a way using Java to over-ride the browser authentication dialog box when
When a modal dialog box is present, messages sent to the main window using

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.