1

We are converting our app from ASPNET Webforms to ASPNET MVC. Currently we are doing small POC's on our exiting features.

We have a dashboard page that looks like below Dashboard

  1. "Member Dashboard", "Account Summary" and "Plan Information" are Partial views(also strongly typed) placed on the parent "Home" Views.

  2. "Member Dashboard" Partial view does not change for a user. But "Account Summary" and "Plan Information" Partial-views has to updated based on the "Plan Type" drop-down.

  3. I have three different models for "Member Dashboard", "Account Summary" and "Plan Information" partial views.

  4. I use @Html.Partial on the the Parent "Home" view and pass model to the partial views.

All works fine.

How can I replace @Html.Partial with @Html.RenderAction for the above scenario? (This way I don't have to use the super-model for the "Home" View.)

How can the "Account Summary" and "Plan Information" section be updated when a user changes "Plan Type" drop-down and click Submit.

McGarnagle
  • 101,349
  • 31
  • 229
  • 260
nfa379
  • 561
  • 3
  • 6
  • 13
  • What's the problem exactly? Can't you just call RenderAction with the correct route values and presto? – McGarnagle Apr 22 '12 at 06:14
  • Yes, @Html.RenderAction works. My qn here is how do i update two partial views when i click on Submit? – nfa379 Apr 22 '12 at 06:15
  • Does it take a long time to render "Member Dashboard"? If not I would put all three in one partial view and update it all - that makes it a LOT easier... – Marc Apr 22 '12 at 06:21
  • No it does not. Since these partial views(not necessarily all 3 together) are shown on other pages as well, we decided against it. – nfa379 Apr 22 '12 at 06:29
  • 1
    @nfa379 I take it you want to do an AJAX call to refresh the views? Or is a full page refresh ok? – McGarnagle Apr 22 '12 at 06:32
  • @dbaseman - OK with both. To start with i would do it without AJAX. – nfa379 Apr 22 '12 at 10:59

0 Answers0