For me, if a the partial view (.ascx or usercontrol in asp.net forms) has a lot of dynamic contents on it, I will make it a strongly typed view. Which means it has its own Model. Depending on its usability. But I strongly advise make each Views its corresponding Model.
For example, in this situation, you have a partial view that has a Model of Address
Partial View
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Address>" %>
Address Name: <%=Model.AddressName %>
Address Location: <%=Model.AddressLocation %>
Model
public class Address
{
public string AddressName {get;set;}
public string AddressLocation {get;set;}
}
And I want to use this Partial View of mine depending on the page that is using. Could be the Login User or the Friends User. What I would do is just call its Corresponding Action in a Controller.
Say I put it in the CommonController
public class CommonController : Controller
{
ModelRepository modelRepository = new ModelRepository();
public PartialViewResult AddressPartialView(int id)
{
var address = modelRepository.GetAddress(id);
return View("AddressPartialView", address);
}
}
In this case I can call this Partial View in any Part of any page by
<%= Html.Action("AddressPartialView", "Common", new { id = Model.AddressId })%>
assuming my View that I was calling the Partial View has a Model of User with a property of AddressId
. This way, I can use and reuse my Partial View in 1 single page, each got different content.