我搞亂了asp.net中的Formview。我知道需要指定UpdateCommand,以便Formview知道要運行的SQL查詢。無法讓Formview更新,我做錯了什麼?
我需要編寫一個事件另外到Formview設置的代碼才能正確觸發SQL查詢嗎?
此外,我沒有收到SQL錯誤或任何東西,它只是不綁定回數據庫。
<EditItemTemplate>
ProductID:
<asp:Label ID="ProductIDLabel1" runat="server"
Text='<%# Eval("ProductID") %>' />
<br />
ProductName:
<asp:TextBox ID="ProductNameTextBox" runat="server"
Text='<%# Bind("ProductName") %>' />
<br />
UnitPrice:
<asp:TextBox ID="UnitPriceTextBox" runat="server"
Text='<%# Bind("UnitPrice") %>' />
<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>
你可以張貼一些代碼? – David 2009-07-30 21:04:33
是你在updatepanel中的formview嗎? – 2009-07-31 03:53:02