views:

117

answers:

2

In our current ASP.Net Webforms application we have several composite/template server controls that only exist for a common look and feel. For example, we have a panel control that has a title, a place for buttons related to the contents of the panel, and of course the contents. How is this best accomplished in MVC? RenderPartial doesn't get done what I need here. Should I still be using the same controls, but just on a view page? These controls don't really do anything on postback, they are only there for a common look and feel.

More Info:

We have a control in Webforms that implements ICompositeControl. We have a few properties on this control like Panel (type Panel), Buttons (again type Panel which would hold buttons) and a property Title of type string. Visually it looks like

alt text

+1  A: 

Templated partial views is the way to go.

RandomNoob
That looks promising. How do you pass in multiple, discreet sections of HTML to be displayed in the partial?
Jason Jackson
I gave you +1 because we are going to use something like that for another issue, but we actually ended up building a different solution for this question.
Jason Jackson
A: 

I'm a little hazy about the exact requirements here but i'f I understand this correctly then you want a control that has say title information with variable content such as static text, controls, images etc etc.

If I had to have a control that acted as a container for content, no matter what that content was, I think I'd consider a Html Helper that I could pass information to and it could make the assessment on what content to render.

It could then either call another helper, render a partial view or whatever.

griegs