First time here? You are looking at the most recent posts. You may also want to check out older archives or the tag cloud. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS. Thank you for visiting! (hide this)

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: ,
posted on Thursday, November 29, 2007 11:23 AM
Comments have been closed on this topic.