Repeater control doesn't have public property ModelType

ⅰ亾dé卋堺 提交于 2019-12-19 17:45:16

问题


I'm trying to use model binding feature of asp.net 4.5. I'm using Repeater control, seting ModelType property on it, but as soon as I run the application, I'm getting parser error, which states, that Repeater doesn't have ModelType public property. Here's markup

<ul>
    <asp:Repeater ID="rptDepartments" runat="server" ModelType="TestWebApp.Models.Department">
        <ItemTemplate>
            <li>
                <%#: Item.DeptName %>
            </li>
        </ItemTemplate>
    </asp:Repeater>
    </ul>

Any ideas ? I saw plenty of examples of using Model Binding in conjuction with repeater control in the web.

I'm using VS 2012 RC.


回答1:


It looks like the ModelType property got renamed to ItemType see http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.repeater.itemtype(v=vs.110).aspx for more info.



来源:https://stackoverflow.com/questions/11153460/repeater-control-doesnt-have-public-property-modeltype

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!