带有Dropdownlist的Gridview数据绑定方法,例如Eval(),XPath()和Bind()

时间:2019-06-13 02:35:07

标签: asp.net

我在Gridview内有一个Gridview和一个下拉列表,当我单击Gridview内的编辑按钮时,它将显示以下错误:

System.InvalidOperationException:'诸如Eval(),XPath()和Bind()之类的数据绑定方法只能在数据绑定控件的上下文中使用。'

我试图删除Gridview内的下拉列表,然后编辑按钮可以正常工作而不会出错。

                                                                                                                                                                                                                                                                   <%----%>                                                                                                               'ReadOnly =“ true”>                                                                                                                                                                                                                                                                                                                                    

                    </asp:GridView>

                    <asp:LinqDataSource ID="ldsRecord" runat="server" ContextTypeName="ShopDataContext" TableName="Record1s" EnableUpdate="True" EntityTypeName="">

0 个答案:

没有答案