I have the following layout:

ButtonA has a specific left and right side layout, while ButtonB and ButtonC have a common left side but a different right side. My question is how I should determine what needs to updated via ajax when the various Button combinations and their respective Controller/Actions are called?
For example, if the current page is ButtonB and then I click ButtonA (same for current page ButtonA then clicking ButtonB or C) both the left and right sides need to be updated (in this case it would be the entire wrapper div). However, if the current page is ButtonB and then I click ButtonC only the right side would need to be updated. Here are a couple options that might work:
-
Have a current page layout id and pass that to the controller/action as a parameter. The action would then determine based upon the current layout to either render the right side or both the left and right side. This would work but is it a MVC best practice?
-
Have the client side ajax know the current page layout and get the left and right side data separately.
Does anyone have any other suggestions or proper ways to do this with MVC?
I’d have something in your content that’s in either div.
Or if it’s a matter of what’s clicked and not what’s in the boxes, then just use global variables: