How to pass data from view to UserControl in ASP.NET MVC?

Posted by Xinxua on Stack Overflow See other posts from Stack Overflow or by Xinxua
Published on 2010-03-24T12:50:54Z Indexed on 2010/03/24 12:53 UTC
Read the original article Hit count: 344

Say I want to do the simplest of the data passing as follows :

<% For i = 0 To 10%>
    <%Html.RenderPartial("MyUserControl")%>
<% Next%>

What I want to do is to pass the variable i as the parameter to the UserControl so that it displays the number inside a, say, bordered div.

How is this possible?

Thanks

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about viewusercontrol