In my View I have:
<%
foreach (Personas p in Model.Personas) {
if (p.DisType == DisType.TextArea) {
%>
<% Html.RenderPartial("~/Views/Shared/Controls/Custom/xxx/Textbox.ascx", p); %>
<%
}
}
%>
First I'm not sure that I have the <% %> right.
Second, in my Partial View Textbox.ascx, I strongly typed it also to my ViewModel class just like I did in my View..the same ViewModel class. My ViewModel class has a Property of type Personas. So I assumed that since I'm passing a p (of type Personas) to my RenderPartial as the object to pass to it, that as long as I have strongly typed my Partial View and that object (which is the ViewModel clas) has that type in it (personas) that I can just do this now in my Partial View:
<fieldset>
<div>
<span>*</span><label><%=Model.Personas.Name %></label>
<p><%=Model.Personas.Info %></p>
</div>
<div>
<%=Html.TextBox(Model.Personas.Name, "",
new { name=Model.Personas.Name, id= Model.Personas.Id,
size = Model.Personas.Size1 })%>
</div>
</fieldset>
Finally, so I tried all this. But nothing gets rendered. I don't know why. I don't know if I just have the syntax wrong in my View or I'm not getting valid data being passed, or that in my Partial View if I'm not wiring up to the passed object correctly.