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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:05:23+00:00 2026-06-09T08:05:23+00:00

I have ajax call of action in the controller, after it update the database

  • 0

I have ajax call of action in the controller, after it update the database and it is completed successfully I can do like this:

return PartialView("Overview", mydatamodel);

and then in the the success to do like this:

success: function (data) { 
            // do something with the data => refresh some
            // portion of your DOM
            $('#someDivId').html(data);
        }

And it would work fine, but what I need is that a collection in the view model to be updated, and the whole view to be rendered again with the new data.

I can do that if for instance I have submit button, then whole view is updated with the new data but if I have ajax call, how can i do that.

Here is link to my previous post where have more details:
MVC3 receiving the new model data after submit

Thank you in advance!

  • 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-09T08:05:25+00:00Added an answer on June 9, 2026 at 8:05 am

    If you want to update the entire view don’t use AJAX. Simply use a submit button. The whole point of AJAX is to update only a portion of the view without navigating away from the current page.

    By the way you could redirect on the client side using window.location.href:

    success: function (data) { 
        window.location.href = '@Url.Action("Overview", "SomeController")';
    }
    

    but there’s really no need to do that if you will always redirect in the success AJAX callback. You should not use AJAX in this scenario.

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

Sidebar

Related Questions

I have an ajax call that looks like this: $.ajax({ url: '@Url.Action(SaveStudy)', type: POST,
So I have this basic action, which is accessed by ajax call, and fetches
I have an ajax call that I'm making to the controller which should update
i have an ajax call $.ajax({ url: '<%=Url.Action(SaveDetails,Survey) %>', dataType: 'JSON', cache: false, data:
I have an ajax call. I put the return value (data) in a variable
I have the following ajax call var prev_sibling = $(this).prev().attr(value); var next_sibling = $(this).next().attr(value);
I have an AJAX controller action which returns JSON. The returned JSON is handled
I have a ajax call to a controller that is supposed to send me
I am trying to achieve a JQuery AJAX call to a controller action method
I have an ajax call which will return a set<E> . I need to

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.