我想在ASP中添加一個網格只使用插入推薦不想在選擇刪除和其他命令上工作,我插入了其他網格但在那裏它顯示其他數據也有任何格,我可以使用插入而已,也想插入多行在ASP中插入網格
<asp:FormView ID="FormView1" runat="server" DataKeyNames="Card_code"
DataSourceID="SqlDataSource1">
<EditItemTemplate>
Card_code:
<asp:Label ID="Card_codeLabel1" runat="server"
Text='<%# Eval("Card_code") %>' />
<br />
Description:
<asp:TextBox ID="DescriptionTextBox" runat="server"
Text='<%# Bind("Description") %>' />
<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>
Card_code:
<asp:TextBox ID="Card_codeTextBox" runat="server"
Text='<%# Bind("Card_code") %>' />
<br />
Description:
<asp:TextBox ID="DescriptionTextBox" runat="server"
Text='<%# Bind("Description") %>' />
<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>
Card_code:
<asp:Label ID="Card_codeLabel" runat="server" Text='<%# Eval("Card_code") %>' />
<br />
Description:
<asp:Label ID="DescriptionLabel" runat="server"
Text='<%# Bind("Description") %>' />
<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.NET或ASP經典? – sajoshi 2011-05-30 09:41:12
好,但他們之間有什麼區別? – Mano 2011-05-30 09:47:42