<%@
Page Language="C#" MasterPageFile="~/DefaultMaster.master" AutoEventWireup="true" CodeFile="DataObjectTypeControl.aspx.cs"
Inherits="DataObjectTypeControl"
Title="DataObjectType instantiation
control" %>
<%@
Register Assembly="ExtendedObjectDataSource" Namespace="Manu.Web.UI.WebControls" TagPrefix="manu" %>
<asp:Content
ID="Content1" ContentPlaceHolderID="Content" Runat="Server">
<h1>DataObject
instantiation control</h1>
<asp:GridView
ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" AutoGenerateDeleteButton="True"
AutoGenerateEditButton="True"
CssClass="gridview"
BackColor="#335789"
BorderColor="#133769"
BorderStyle="Solid"
BorderWidth="1px"
DataKeyNames="Id"
DataSourceID="ObjectDataSource1"
PageSize="4">
<Columns>
<asp:BoundField
DataField="Id"
HeaderText="Id"
ReadOnly="True"
SortExpression="Id"
/>
<asp:BoundField
DataField="Name"
HeaderText="Name"
SortExpression="Name"
/>
</Columns>
<RowStyle
BackColor="White"
ForeColor="#436799"
/>
<HeaderStyle
ForeColor="White"
/>
<PagerStyle
ForeColor="White"
/>
</asp:GridView>
<manu:CompatObjectDataSource
ID="ObjectDataSource1"
runat="server"
DataObjectTypeName="Product"
DeleteMethod="Delete"
InsertMethod="Add"
OldValuesParameterFormatString="old_{0}"
SelectMethod="LoadAll"
TypeName="ProductsDAL"
UpdateMethod="Edit"
OnDeleted="ObjectDataSource1_Deleted"
OnInserted="ObjectDataSource1_Inserted"
OnSelected="ObjectDataSource1_Selected"
OnUpdated="ObjectDataSource1_Updated"
MaximumRowsParameterName="maxRows" StartRowIndexParameterName="startIndex"
EnablePaging="true"
SelectCountMethod="CountAll"
SortParameterName="sortedBy"
OnDataObjectCreating="ObjectDataSource1_DataObjectCreating"
OnDataObjectCreated="ObjectDataSource1_DataObjectCreated">
</manu:CompatObjectDataSource>
<br
/>
<asp:DetailsView ID="DetailsView1"
runat="server"
AutoGenerateRows="False"
DataKeyNames="Id"
DataSourceID="ObjectDataSource1"
DefaultMode="Insert"
Height="50px"
Width="125px" CssClass="htmltable">
<Fields>
<asp:BoundField
DataField="Name"
HeaderText="Name"
SortExpression="Name"
/>
<asp:BoundField
DataField="Description"
HeaderText="Description"
SortExpression="Description"
/>
<asp:BoundField
DataField="Price"
HeaderText="Price"
SortExpression="Price"
/>
<asp:CommandField
ShowInsertButton="True"
/>
</Fields>
<CommandRowStyle
ForeColor="White"
/>
</asp:DetailsView>
<br
/>
<asp:Label
ID="lbResult" runat="server" EnableViewState="False"></asp:Label>