I have repetitious markup for elements, like:
<div class='box'> <div class='top'></div> <div class='content'> content goes here </div> <div class='bottom'></div> </div>
Top and bottom are styled with css to include images for borders.
I could use JQuery to inject tags, but is there a better way to template controls in asp.net mvc?
Thank you
There are probably a lot of ways around this, here’s one:
Create a ViewUserControl (let’s call it ‘box.ascx’):
In your aspx, wherever you need this block, call it like this:
Here’s the Lambda helper class:
If you don’t use this little helper it will crash since it will try to cast the Action.