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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:26:20+00:00 2026-06-05T05:26:20+00:00

Here’s what happens: Partial views A and B show the same model View A

  • 0

Here’s what happens:

  1. Partial views A and B show the same model
  2. View A changes the data via Ajax (using Ajax.BeginForm)
  3. View A re-renders itself (controller gets the updated model from the database)
  4. Now we have to re-render View B as well, because the data has been changed, right?
  5. We get the updated model from the database again and re-render View B

How do I prevent re-querying the database? Maybe cache the model-instance in the Session?

What’s the “right” way to do this?

<!--works great when the page is rendered
    via postback but what about Ajax?--!>
<div>
@Html.Partial(@ViewA", MyModelInstance)
@Html.Partial(@ViewB", MyModelInstance)
</div>
  • 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-05T05:26:21+00:00Added an answer on June 5, 2026 at 5:26 am

    Can you create a new partial View C that contains both A and B. Whenever the model changes you have to invoke the action that returns the View C.

    UPDATE:

    The other simple solution I see is when View A updates the model instead of re-rendering the view, get the updated model through AJAX and the update HTML portions through javascript. If you are using jquery you can use the template plugin to update the html quite easily.
    By this way you can avoid making one more unnecessary request to update the other View B.

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

Sidebar

Related Questions

Here's what I'm doing. I want to upload multipart file via Ajax to my
Here's the setup - I have a view that lists products. On that same
here is my problem. I'm using MVC and in a lot of Index Views
Here is the code I'm using inside my AsyncTask DefaultHttpClient httpClient = new DefaultHttpClient();
Here my problem: @Assert\Regex( * pattern=/^[A-Za-z0-9][A-Za-z0-9\]*$/, * groups={creation, creation_logged} * ) I'm using the
Here is the situation. I am making changes to an application but I do
Here's a sample of a SpinBox that writes its changes to underlying variables. The
Here is my simplified data structure: Object1.h template <class T> class Object1 { private:
Here is the scenario: I'm writing an app that will watch for any changes
Here's my situation: I have a Data Template set up which contains a ToggleButton

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.