10.15. Further Control Enhancements

There are a number of control enhancements and a couple of miscellaneous new controls as well.

10.15.1. Wizard Control

The Wizard control now contains new templating functionality (LayoutTemplate).

10.15.2. ListView Enhancements

In previous versions of ASP.NET, when a row was selected within a ListView (or GridView) and the user moved to another page, the selection was maintained on the next page. This can be bad news if you then use this selection to perform an action on the selected record.

ASP.NET 4.0 resolves this problem with the new EnablePersistedSelection property. If EnablePersistedSelection is set to True, then row selection is maintained using the data key of each item.

Another welcome change is that the declaration of ListViews has been much simplified. The following code shows how a ListView control had to be declared previously:

<asp:ListView ID="lstView" runat="server">
    <LayoutTemplate>
        <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
    </LayoutTemplate>

    <ItemTemplate>
        <%# Eval("firstname")%>
    </ItemTemplate>
</asp:ListView>

ASP.NET 4.0 allows you to do the following:

<asp:ListView ID="ListView1" runat="server">
    <ItemTemplate>
        <%# Eval("firstname") %>
    </ItemTemplate>
</asp:ListView>

10.15.3. GridView

The GridView control now supports persisted selection (see the previous example), offers the ability to style header columns when they are sorted, and contains improved support for working with ViewState disabled.

10.15.4. CompareValidator

The CompareValidator control now supports the comparison of Time and DateTime values.

10.15.5. QueryExtender

QueryExtender is a new control that aims to make filtering data easier by providing a declarative query syntax that you can link to the Entity or LinqDataSource control.

10.15.6. Browser Capability Files

Browser capability files are for determining how best to render content for individual browsers and are held in XML format. If you feel the need (perhaps to override the rendering capabilities for iPhones, for example), you can create your own browser provider by deriving from the HttpCapabilitiesProvider class.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.178.9