诸如Eval,XPath和Bind之类的数据绑定方法只能在手动和自动注销的数据绑定控件的上下文中使用

问题描述

我整天都在看这本书,并尝试从其他人的错误消息中尝试一些东西,但无济于事,所以现在我遇到了以下问题。表单视图中的代码。 当我单击菜单栏上的注销时,我得到以下信息 “诸如Eval(),XPath()和Bind()之类的数据绑定方法只能在数据绑定控件的上下文中使用” 现在,只有在程序自动注销或单击注销按钮时,才会发生这种情况。 单击“保存”时不会发生,一切顺利。 这是我的代码

  </div>
                    <div class="serviceBox16">
                        <asp:DropDownList ID="AssistantSurgeonNameDDL" runat="server"
                            Style="text-align: left;" 
                            Width="100%" 
                            DataSourceID="sqlDataSource9" 
                            DataValueField ="AssistantSurgeonName" 
                            DataTextField ="AssistantSurgeonName" 
                            OnLoad ="AssistantSurgeonNameDDL_load"
                            AppendDataBoundItems="true"
                            SelectedValue ='<%# Bind("AssistantSurgeonName") %>'>
                            <asp:ListItem></asp:ListItem>
                        </asp:DropDownList>
     <%--                        <asp:TextBox ID="AssistantSurgeonNameTextBox" runat="server" autocomplete="off" Style="text-align: left;" Width="100%" Text='<%# Bind("AssistantSurgeonName") %>' />--%>
                    </div>

                    <div class="serviceBox16">
                        <asp:TextBox ID="ESR01_02TextBox" runat="server" autocomplete="off" Style="text-align: left;" Width="100%" Text='<%# Bind("ESR01_02") %>' />
                    </div>

                    <div class="ServiceBox16">
                        <asp:DropDownList ID="ESR04DDL" runat="server" 
                            Style="text-align: left;"
                            Width="100%" 
                            DataSourceID="sqlDataSource8" 
                            DataValueField ="PositionChange" 
                            DataTextField ="PositionChange" 
                            OnLoad ="ESR04ddl_load"
                            AppendDataBoundItems="true"
                            SelectedValue ='<%# Bind("ESR04") %>'>
                            <asp:ListItem></asp:ListItem>
                            
                            </asp:DropDownList>
                        <%--<asp:TextBox ID="ESR04TextBox" runat="server" Style="text-align: left;"           autocomplete="off" Width="100%" Text='<%# Bind("ESR04") %>' />--%>
                    </div>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...