The same day VS2008 was released, Microsoft released also a training kit with 120Mb of PPT, demos and code samples.

Among the many demos there is one about the new features of ASP.NET introduced with the framework 3.5: LinqDataSource, DataPager, and ListView.

But the code for the sample on the ListView contains an error, probably because it was developed with the beta2, and it happens that the RTM has a breaking change on this.

With Beta2 you could do (warning, this won't work with VS2008 RTM):

<asp:ListView ID="ListView1" 
runat="server" ItemPlaceholderID="itemContainer">
    <LayoutTemplate>
        <ul id="itemContainer" runat="server">
        </ul>
    </LayoutTemplate>
    <ItemTemplate>
        <li>
          <%#Eval("Name")%>, 
           <%#Eval("Count") %>
        </li>
    </ItemTemplate>
</asp:ListView>

Now, with the RTM, you have to do:

<asp:ListView ID="ListView1" 
   runat="server" ItemPlaceholderID="itemContainer">
    <LayoutTemplate>
        <ul>
         <asp:PlaceHolder id="itemContainer" runat="server">
         </asp:PlaceHolder>
        </ul>
    </LayoutTemplate>
    <ItemTemplate>
        <li>
          <%#Eval("Name")%>, 
          <%#Eval("Count") %>
        </li>
    </ItemTemplate>
</asp:ListView>

Technorati Tag: ,