我搞乱了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