By now, most of you have heard about the new GridView control and stuff like that.  However, the new FormView control allows you to quickly create the ability to display and edit data while giving you full control of your HTML markup.
 
The FormView control binds to a DataSource control just like the GridView.  The beauty of a FormView control is that when you bind it to a typed dataset or whatever using a datasource control.  It will automatically generate a template for displaying and editing items from that datasource.
 
For example, I didn't have to type any of the code below.  All I did was drag and drop an ObjectDataSource control and a FormView control in the designer.  I used the menu to configure the data source and bind the formview to that data source.
 
<asp:FormView ID="FormView1" Runat="server" DataSourceID="ObjectDataSource1">
    <EditItemTemplate>
        CarModelId:
        <asp:TextBox Text='<%# Bind("CarModelId") %>' Runat="server" ID="CarModelIdTextBox"></asp:TextBox><br />
        ImageFileName:
        <asp:TextBox Text='<%# Bind("ImageFileName") %>' Runat="server" ID="ImageFileNameTextBox"></asp:TextBox><br />
        ThumbnailImageFileName:
        <asp:TextBox Text='<%# Bind("ThumbnailImageFileName") %>' Runat="server" ID="ThumbnailImageFileNameTextBox"></asp:TextBox><br />
        LuggageCount:
        <asp:TextBox Text='<%# Bind("LuggageCount") %>' Runat="server" ID="LuggageCountTextBox"></asp:TextBox><br />
        PassengerCount:
        <asp:TextBox Text='<%# Bind("PassengerCount") %>' Runat="server" ID="PassengerCountTextBox"></asp:TextBox><br />
        Description:
        <asp:TextBox Text='<%# Bind("Description") %>' Runat="server" ID="DescriptionTextBox"></asp:TextBox><br />
        MatchedBy:
    </EditItemTemplate>
    <ItemTemplate>
        CarModelId:
        <asp:Label Text='<%# Bind("CarModelId") %>' Runat="server" ID="CarModelIdLabel">
        </asp:Label><br />
        ImageFileName:
        <asp:Label Text='<%# Bind("ImageFileName") %>' Runat="server" ID="ImageFileNameLabel">
        </asp:Label><br />
        ThumbnailImageFileName:
        <asp:Label Text='<%# Bind("ThumbnailImageFileName") %>' Runat="server" ID="ThumbnailImageFileNameLabel">
        </asp:Label><br />
        LuggageCount:
        <asp:Label Text='<%# Bind("LuggageCount") %>' Runat="server" ID="LuggageCountLabel">
        </asp:Label><br />
        PassengerCount:
        <asp:Label Text='<%# Bind("PassengerCount") %>' Runat="server" ID="PassengerCountLabel">
        </asp:Label><br />
        Description:
        <asp:Label Text='<%# Bind("Description") %>' Runat="server" ID="DescriptionLabel">
        </asp:Label><br />
    </ItemTemplate>
</asp:FormView>
<asp:ObjectDataSource ID="ObjectDataSource1" Runat="server" TypeName="Thrifty.Components.Web.Locations.Resources.Locations"
    SelectMethod="GetFleetByLocationCode">
    <SelectParameters>
        <asp:Parameter Type="String" Name="locationCode"></asp:Parameter>
    </SelectParameters>
</asp:ObjectDataSource>
 
The FormView control has various templates but the two it autogenerates are ItemTemplate and EditItemTemplate.  ItemTemplate displays the data and EditItemTemplate provides a means to edit the items.  This control can easily be used in conjunction with the GridView control to provide a master/details data editor. 
 
This means that creating simple data editors that used to take several hours can probably now be done in a manner of minutes.

Read the complete post at http://www.dotnettipoftheday.com/blog.aspx?id=216