If you have:
System.Web.Mvc.ViewUserControl<T>
how do you access T at runtime?
I have a base class which I pass into
Html.RenderPartial("ViewName", BaseControlModel);
but I want to create another extension method such as
Html.RenderTypedPartial("ViewName", BaseControlModel);
such that in the context of ViewName.ascx my BaseControlModel is transformed into type T from the original declaration. I already have the code to transform BaseControlModel into the type I expect, it looks like this:
BaseControlModel.GetModel<T>();
but I want to invoke this inside RenderTypedPartial generically, instead of specifically requesting type T in my view.
10/5 update: I went ahead and copy pasted RenderPartial and FindPartialView into my own extension method from the source on CodePlex and the type I get for my IView reference is a WebFormView which doesn't have the type as a generic argument that I defined in my partial .ascx...