views:

94

answers:

1

I have a user control I use multiple times on a page. It uniformly formats some object "X" and allows certain interactions. What I'd like to do is to pass a separate object to each separate instance of the user control. I'm currently rendering the controls as below, and just depending on some specific ViewData being set. I'd like to make it more generic than that.

<% Html.RenderPartial("Vignet"); %>
+2  A: 

Use a strongly typed partial view, and pass the model explicitly:

<% Html.RenderPartial("Vignet", Model.VignetData); %>
Craig Stuntz