Scenario:
platform: ASP.NET 4.0, MVC 2.0 (doesn't have to be MVC if it's not the right solution)
Create various widgets that inherit the same core markup:
<div class="widget">
<div class="hd-widget">
<!-- dynamically inject code here for each actual widget -->
</div>
<div class="bd-widget">
<!-- dynamically inject code here for each actual widget -->
</div>
<div class="ft-widget">
<!-- dynamically inject code here for each actual widget -->
</div>
</div>
The above "simplified" example should be in some reusable control or masterpage.
The flow is something like this:
Controller -> View -> Partial View (1..n) -> widget markup
User instantiates an action which calls a controller. The controller tries to render a view that contains content + multiple widgets (left rail, right rail, etc). The Widgets all have their own individual partial views but each partial view should inherit or consume a base set of widget markup and have controller areas where to embed functionality.
Functionality in the head, body, and footer can either be plain text, HTML, or additional custom controls.
What is the best recommended approach?