2011-05-30 125 views
0

我想在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" /> 
       &nbsp;<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" /> 
       &nbsp;<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" /> 
       &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
        CommandName="Delete" Text="Delete" /> 
       &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
        CommandName="New" Text="New" /> 
      </ItemTemplate> 
     </asp:FormView> 

這裏是該代碼的代碼我只希望插入命令不希望執行其他操作

+0

能否請您在這裏發表您的代碼?也是它的ASP.NET或ASP經典? – sajoshi 2011-05-30 09:41:12

+0

好,但他們之間有什麼區別? – Mano 2011-05-30 09:47:42

回答

0
+0

它也只是做同樣的事情,即時通訊嘗試,但現在我想知道是否有任何過程插入數據到網格與出使用選擇命令和更新命令 – Mano 2011-05-30 10:00:48

+0

只是從網格中刪除它們! – danyolgiax 2011-05-30 10:01:41

+0

如何清除Grid/???如果我刪除網格,那麼我如何插入數據 – Mano 2011-05-30 10:03:43