Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Repeater control doesn't have public property ModelType

Tags:

asp.net-4.5

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.

like image 789
Michael Avatar asked Jun 22 '12 09:06

Michael


1 Answers

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.

like image 123
Gloopy Avatar answered Oct 19 '22 10:10

Gloopy