"partial views" best practices for 'container' divs?

Posted by ropstah on Stack Overflow See other posts from Stack Overflow or by ropstah
Published on 2010-05-01T21:32:09Z Indexed on 2010/05/01 21:37 UTC
Read the original article Hit count: 253

Filed under:
|
|

What is the 'best' way to handle the html markup for partial views? (which are also refreshed using AJAX) The biggest issue I run into is where to place the 'container' div...

Consider having a masterpage and a partial view.
(class="" could be interchanged with id="" depending if the partial is guaranteed to be unique, however this isn't really important to the issue i think)

Masterpage:

<div id="place1" class="placeholder">
<!-- render partial -->
</div>

Partial:

<div id="partial1" class="partial">
<!-- content -->
</div>

I feel that something isn't being done right. However I cannot remove the div in the masterpage, because I need that to 'encapsulate' the response from AJAX partial updates. And also I cannot move the div in the partial to the masterpage, because that would require to move 'partial' info to the masterpage...

How do you handle this?

© Stack Overflow or respective owner

Related posts about html

Related posts about AJAX