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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:04:33+00:00 2026-05-12T00:04:33+00:00

I have a view which is composed of top, left and bottom headers and

  • 0

I have a view which is composed of top, left and bottom headers and a main contents pane. Suppose that during an AJAX request I need to update the HTML of the top, bottom and main panels (the left header should stay the same).

I was wondering what would be the best way to accomplish this. The first thought was to put the main contents panel into a partial and have a controller action that would return PartialView. This wouldn’t work because as the action returns only the HTML of the main pane I cannot update the top and bottom headers.

So if I put the top and bottom headers into their own respective partial views I would need my controller action to return multiple partial views. Is this possible at all or I am doing something completely off the track?

I saw that it is possible to render a partial view to a string so I thought that I could use this technique in the action to return a JSON object with 3 properties representing the HTML of the 3 partials that I need to update. But this feels like a very wrong approach to me if possible at all.

Another idea I had was to return a JSON object only containing the data necessary for the partials and use javascript to construct the HTML. But building an UI in javascript looks like a difficult job (The main contents partial uses MvcContrib’s GridView with paging and sorting).

So I would really appreciate suggestions on what would be the cleanest approach to handle such scenario. Also an adaptive solution would be great: for example if the user has
javascript disabled it would just reload the whole page without AJAX.


UPDATE:

Andrew Siemer suggested placing each section into its own partial view and perform multiple ajax requests. This seems like a perfectly valid approach but unfortunately it is not applicable in my scenario because of the following detail I missed in my initial problem description: the top header is actually used to display error/information messages of events occurring in the main panel. So for example I need to show the error message in case an exception is thrown when fetching the model for the main panel. So only a single request could be made in order to update those two panels.

  • 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-12T00:04:33+00:00Added an answer on May 12, 2026 at 12:04 am

    You can easily place each section into its own partial view. This would then allow you to make a jquery request for each view once your data has been submitted/changed. Each call could then be pushed into the appropriate section. This is very doable and sounds like the appropriate path.

    I would not expect your controller to return multiple partial views…as this will break SRP!

    Update: In following with your update…you can still fetch the sections separately. This simply takes a bit more ajax coolness on your part in that each fetch can return an error chunk (by way of a JSON request). If any error comes back then those error messages can be displayed in the header. Or…you can make the header request last for errors once all of the other requests have reported back in which case each partial view can toss it’s error messages to a session variable for the error state…and then show those messages in the header.

    A big reason for choosing to go with each section as it’s own section rather than one uber request may not yet be apparent in the initial design. With each section being controlled separately you can then do fancy things such as caching each section independently, providing more frequent updates in one area over another, etc.

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

Sidebar

Related Questions

I have an application composed of a main view and a secondary view which
I have a view which has two labels. When I swipe left I fill
I have a view which was working fine when I was joining my main
I have a view that contains a UITableView and a UILabel which works perfectly
I have a custom view which is composed of a number of UIImageViews. These
I have view on which I defined a custom tagName. I need to be
i have view controller which contains a button which show the image library ,if
I have a view which I would like to fill up the entire screen
I have a view which I built in Interface builder with a tableview and
I have 5 view which have deferent json data , in all my 5

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.