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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:13:07+00:00 2026-05-21T03:13:07+00:00

I’ve been working on my first major ASP.NET MVC application (plus lots of jQuery)

  • 0

I’ve been working on my first major ASP.NET MVC application (plus lots of jQuery) for a month or so now and I’m pretty happy with it. I have a page that looks something like this. (Actual data changed to protected the innocent.)

<div id="main"></div>
<div id="movies"></div>
<div id="actors"></div>
<div id="actor-ratings"></div>
<div id="ratings-comments"></div>

The movies div contains a table of movies to select from. The actors, actor-ratings, and ratings-comments divs are all hidden at this point. When a movie is clicked, I have a jQuery live() event to get the click, post to the Action, get the data, and then a callback function to take the data and place it in a modal pop-up. (I think I have that order right, feel free to tell me if I’m doing it wrong anywhere.)

Since actors, actor-ratings, and ratings-comments all potentially need to be loaded in one page, my controller ends up having a huge action to load all that data in. Plus, the ratings-comments div may close the actor-ratings modal and open itself up in a new modal. And on top of it I want to implement the jQuery Address plugin to allow the back button to go back to previously opened modals.

Gets kind of complex pretty quick. Should I be using partial views for each of those divs? Should I have one controller with actions for each of those? Or a controller for each partial view/div? Partial divs seems like the way to go, but I guess I’m looking for some guidance before I jump in and break up my code. Any advice would be appreciated.

Edit: Also, my actor-ratings partial view would probably need some of the data from the actors partial view. Do I just have my ActorRatings controller action load in the actor data too? (I’m passing strongly-typed view models to the view.)

  • 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-21T03:13:08+00:00Added an answer on May 21, 2026 at 3:13 am

    How you break up your code doesn’t necessarily matter too much so long as it consistently separates logically different parts of the application.

    For a page which is driven by lots of partial views which are closely related I would be tempted to put the action methods in a single controller. However, if you’re looking to make a very rich AJAX-driven page then you might benefit from splitting disparate functionality into separate controllers.

    Returning a partial view from the action methods is probably the most maintainable and flexible solution but returning JSON would use the least bandwidth. For what you’ve described I would be tempted to return partial views.

    It’s difficult to comment on the shared data between Actors and ActorRatings without more detail. Can’t the Actors action method get all the detail it needs or is it updating due to the ActorRatings method being called?

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

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.