Основы ASP.NET 2.0



         

FormView - часть 2


<asp:FormView ID="FormView1" runat="server" DataKeyNames="au_id" DataSourceID="SqlDataSource1"> <EditItemTemplate> au_id: <asp:Label ID="au_idLabel1" runat="server" Text='<%# Eval("au_id") %>'></asp:Label><br /> au_lname: <asp:TextBox ID="au_lnameTextBox" runat="server" Text='<%# Bind("au_lname") %>'> </asp:TextBox><br /> au_fname: <asp:TextBox ID="au_fnameTextBox" runat="server" Text='<%# Bind("au_fname") %>'> </asp:TextBox><br /> phone: <asp:TextBox ID="phoneTextBox" runat="server" Text='<%# Bind("phone") %>'> </asp:TextBox><br /> address: <asp:TextBox ID="addressTextBox" runat="server" Text='<%# Bind("address") %>'> </asp:TextBox><br /> city: <asp:TextBox ID="cityTextBox" runat="server" Text='<%# Bind("city") %>'> </asp:TextBox><br /> state: <asp:TextBox ID="stateTextBox" runat="server" Text='<%# Bind("state") %>'> </asp:TextBox><br /> zip: <asp:TextBox ID="zipTextBox" runat="server" Text='<%# Bind("zip") %>'> </asp:TextBox><br /> contract: <asp:CheckBox ID="contractCheckBox" runat="server" Checked='<%# Bind("contract") %>' /><br /> <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update"> </asp:LinkButton> <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"> </asp:LinkButton> </EditItemTemplate> <InsertItemTemplate> au_id: <asp:TextBox ID="au_idTextBox" runat="server" Text='<%# Bind("au_id") %>'> </asp:TextBox><br /> au_lname: <asp:TextBox ID="au_lnameTextBox" runat="server" Text='<%# Bind("au_lname") %>'> </asp:TextBox><br /> au_fname: <asp:TextBox ID="au_fnameTextBox" runat="server" Text='<%# Bind("au_fname") %>'> </asp:TextBox><br /> phone: <asp:TextBox ID="phoneTextBox" runat="server" Text='<%# Bind("phone") %>'> </asp:TextBox><br /> address: <asp:TextBox ID="addressTextBox" runat="server" Text='<%# Bind("address") %>'> </asp:TextBox><br /> city: <asp:TextBox ID="cityTextBox" runat="server" Text='<%# Bind("city") %>'> </asp:TextBox><br /> state: <asp:TextBox ID="stateTextBox" runat="server" Text='<%# Bind("state") %>'> </asp:TextBox><br /> zip: <asp:TextBox ID="zipTextBox" runat="server" Text='<%# Bind("zip") %>'> </asp:TextBox><br /> contract: <asp:CheckBox ID="contractCheckBox" runat="server" Checked='<%# Bind("contract") %>' /><br /> <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert"> </asp:LinkButton> <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"> </asp:LinkButton> </InsertItemTemplate> <ItemTemplate> au_id: <asp:Label ID="au_idLabel" runat="server" Text='<%# Eval("au_id") %>'></asp:Label><br /> Author's name: <asp:Label ID="au_fnameLabel" runat="server" Text='<%# Bind("au_fname") %>'></asp:Label>




Содержание  Назад  Вперед