<div style="text-align: center"> how to add two number using form view</div> <div> <asp:FormView ID="FormView1" runat="server" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="addnumber" DefaultMode="Insert" ForeColor="Black" GridLines="Vertical" style="margin-right: 572px" Width="810px"> <FooterStyle BackColor="#CCCC99" /> <RowStyle BackColor="#F7F7DE" /> <EditItemTemplate> n1: <asp:TextBox ID="n1TextBox" runat="server" Text='<%# Bind("n1") %>' /> <br /> n2: <asp:TextBox ID="n2TextBox" runat="server" Text='<%# Bind("n2") %>' /> <br /> result: <asp:TextBox ID="resultTextBox" runat="server" Text='<%# Bind("result") %>' /> <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> <table style="width:100%;"> <tr> <td class="style1"> number 1</td> <td class="style2"> <asp:TextBox ID="n1TextBox" runat="server" Text='<%# Bind("n1") %>' /> </td> <td> <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" /> </td> </tr> <tr> <td class="style1"> number 2</td> <td class="style2"> <asp:TextBox ID="n2TextBox" runat="server" ontextchanged="n2TextBox_TextChanged" Text='<%# Bind("n2") %>' /> </td> <td> <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> </td> </tr> <tr> <td class="style1"> </td> <td class="style2"> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="get result" /> </td> <td> </td> </tr> <tr> <td class="style1"> result</td> <td class="style2"> <asp:TextBox ID="resultTextBox" runat="server" Text='<%# Bind("result") %>' /> </td> <td> </td> </tr> </table> <br /> </InsertItemTemplate> <ItemTemplate> n1: <asp:Label ID="n1Label" runat="server" Text='<%# Bind("n1") %>' /> <br /> n2: <asp:Label ID="n2Label" runat="server" Text='<%# Bind("n2") %>' /> <br /> result: <asp:Label ID="resultLabel" runat="server" Text='<%# Bind("result") %>' /> <br /> </ItemTemplate> <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" /> <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" /> </asp:FormView> <asp:AccessDataSource ID="addnumber" runat="server" DataFile="~/App_Data/test.mdb" InsertCommand="INSERT INTO [add] (n1, n2, result) VALUES (?, ?, ?)" SelectCommand="SELECT [n1], [n2], [result] FROM [add]"> </asp:AccessDataSource> </div>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)