1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Prueba._Default" Title="<%$ Resources:Labels, Contact %>" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Bug #6077722 test</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:FormView ID="FormView1" runat="server" DataSourceID="ObjectDataSource1" DataKeyNames="M1">
<EditItemTemplate>
M1:
<asp:TextBox ID="M1TextBox" runat="server" Text='<%# Bind("M1") %>' />
<br />
M2:
<asp:TextBox ID="M2TextBox" runat="server" Text='<%# Bind("M2") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<InsertItemTemplate>
M1:
<asp:TextBox ID="M1TextBox" runat="server" Text='<%# Bind("M1") %>' />
<br />
M2:
<asp:TextBox ID="M2TextBox" runat="server" Text='<%# Bind("M2") %>' />
<br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" />
<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
<%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %>M1: <asp:Label ID="M1Label" runat="server" Text='<%# Bind("M1") %>' /><br />M2: <asp:Label ID="M2Label" runat="server" Text='<%# Bind("M2") %>' /><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
<br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" />
<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" />
<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New" Text="New" />
</ItemTemplate>
</asp:FormView>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1" onselectedindexchanged="GridView1_SelectedIndexChanged" DataKeyNames="M1">
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="M1" HeaderText="M1" SortExpression="M1" />
<asp:BoundField DataField="M2" HeaderText="M2" SortExpression="M2" />
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete" InsertMethod="insert" OldValuesParameterFormatString="old{0}" SelectMethod="Retrieve"
TypeName="Prueba.DataSource" UpdateMethod="Update">
<DeleteParameters>
<asp:Parameter Name="oldM1" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="m1" Type="Int32" />
<asp:Parameter Name="m2" Type="String" />
<asp:Parameter Name="oldM1" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="m1" Type="Int32" />
<asp:Parameter Name="m2" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
</div>
</form>
</body>
</html>
|