У этой проблемы методы привязки данных, такие как eval (), xpath () и bind (), могут использоваться только в контексте элемента управления привязкой данных.
Страница отлично работает, может редактировать и сохранять, возвращаться на главную или другую страницу из строки меню, но не может выйти со страницы или автоматически выйти со страницы, просто получите сообщение об ошибке, если я продолжу, он вернется к журналу страницы, и все снова хорошо
Проблема возникла, когда я поместил два выпадающих списка в представление формы
вот этот код
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AdminClose.aspx.cs" Inherits="Unisports.AccessControlled.AdminClose" %> <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"> <div class="jumbotron" style="width: 100%;"> <div class="header" style="width: 100%;"> UNISPORTS ORTHO LTD - ADMIN FORM <br /> <br /> </div> <div class="serviceBox"> <asp:FormView ID="FormView1" runat="server" AllowPaging="True" Width="100%"> <ItemTemplate> <div class="serviceBox" style="width: 100%;"> <edititemtemplate> <div class="serviceBox1" style="font-weight:600;"> Hospital </div> <div class="serviceBox2" > <asp:TextBox ID="HospitalTextBox" runat="server" Width="100%" Text='<%# Bind("Hospital") %>' BorderStyle="None" style="font-weight:600; text-align:left; " /> </div> <div class="serviceBox3"> Admit Time </div> <div class="serviceBox4"> <asp:TextBox ID="AdmitTimeTextBox" runat="server" Text='<%# Eval("AdmitTime","{0:hh:mm}") %>' BorderStyle="None" /> </div> <div class="serviceBox1"> Surgery Date </div> <div class="serviceBox2"> <asp:Label ID="SurgeryDateLabel" runat="server" Text='<%# Eval("SurgeryDate","{0:d}") %>' /> </div> <div class="serviceBox3"> Operation Order </div> <div class="serviceBox4"> <asp:Label ID="OperationOrderLabel" runat="server" Text='<%# Bind("OperationOrder") %>' /> <br /> </div> <div class="serviceBox1"> Surgeon </div> <div class="serviceBox2"> <asp:Label ID="SurgeonLabel" runat="server" Text='<%# Bind("Surgeon") %>' /> </div> <div class="serviceBox3"> Nights Stayed </div> <div class=serviceBox4> <asp:Label ID="NightsHospLabel" runat="server" Text='<%# Bind("NightsHosp") %>' /> <br /> </div> <div class="serviceBox1"> <asp:Label ID="Label6" runat="server" Text="Anaesthetist" /> </div> <div class="serviceBox2"> <asp:Label ID="AnaesthetistLabel" runat="server" Text='<%# Bind("Anaesthetist") %>' Width="5cm" /> </div> <div class="serviceBox3"> <asp:Label ID="SurFee" runat="server" Text="Surgeons Fee" /> </div> <div class="serviceBox4"> <asp:Label ID="SurgeonFee" runat="server" Text='<%# Bind("SurgeonFee","{0:c}") %>' /> <br /> </div> <div> <asp:Label ID="Label1" runat="server" Width="100%" style="border-top-color:black; border-top-style:solid;"></asp:Label> </div> <br /> <div class="serviceBox1" style="font-weight:600;"> Patient </div> <div class="serviceBox2" style="font-weight:600;" > <asp:Label ID="PatientLabel" runat="server" Text='<%# Bind("Patient") %>' /> </div> <div class="serviceBox3"> NHI </div> <div class="serviceBox4"> <asp:Label ID="NHINumberLabel" runat="server" Text='<%# Bind("NHINumber") %>' /> <br /> </div> <div class="serviceBox1"> Address </div> <div class="serviceBox2"> <asp:Label ID="AddressLabel" runat="server" Text='<%# Bind("Address") %>' /> <br /> </div> <div class="serviceBox3"> DOB </div> <div class="serviceBox4"> <asp:Label ID="DateofBirthLabel" runat="server" Text='<%# Bind("DateofBirth","{0:d}") %>' /> <br /> <br /> </div> <div class="serviceBox1"> Email </div> <div class="serviceBox2"> <asp:Label ID="EmailLabel" runat="server" Width="50%" Text='<%# Bind("Email") %>' /> </div> <div class="serviceBox3"> Gender </div> <div class="serviceBox4"> <asp:Label ID="GenderLabel" runat="server" Width="50%" Text='<%# Bind("Gender") %>' /> <br /> </div> <div class="serviceBox1"> Contact Ph #'s </div> <div class="serviceBox2"> Home <asp:Label ID="HomePhLabel" runat="server" Width="50%" Text='<%# Bind("HomePh") %>' /> </div> <div class="serviceBox3"> Patients File No </div> <div class="serviceBox4"> <asp:Label ID="Label5" runat="server" Width="50%" Text='<%# Bind("PatientFileNo") %>' /><br /></div> <div class="serviceBox1" style="color:white;"> nothing to display </div> <div class="serviceBox2"> Mobile <asp:Label ID="MobileLabel" runat="server" Text='<%# Bind("Mobile") %>' /> </div> <div class="serviceBox3" style="color:white;">nothing to display </div> <div class="serviceBox4" style="color:white;"> nothing to display <br /></div> <div class="serviceBox1" style="color:white;"> nothing to display </div> <div class="serviceBox2"> Work <asp:Label ID="WorkPhLabel" runat="server" Text='<%# Bind("WorkPh") %>' /> </div> <div class="serviceBox3" style="color:white;">nothing to display </div> <div class="serviceBox4" style="color:white;"> nothing to display <br /></div> <div> <asp:Label ID="Label22" runat="server" Width="100%" style="border-top-color:black; border-top-style:solid;"></asp:Label> </div> <br /> <div class="serviceBox1"> ARTP Description: </div> <div class="serviceBox2"style="width:80%;"> <asp:Label ID="Label23" runat="server" style="width:100%" Text='<%# Bind("ARTPDescription") %>' /> <br /> </div> <div> <asp:Label ID="Label4" runat="server" Width="100%" style="border-top-color:black; border-top-style:solid;"></asp:Label> </ItemTemplate> <PagerTemplate> </PagerTemplate> </asp:FormView> </div> <asp:SqlDataSource ID="SqlDataSource6" runat="server"></asp:SqlDataSource> <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" DataKeyNames="PatientSurgeryID" DataSourceID="SqlDataSource7" Width="100%"> <Columns> <asp:BoundField DataField="Side" HeaderText="Side" SortExpression="Side" > <HeaderStyle CssClass="gridView_th" /> <ItemStyle CssClass="gridView_th" /> </asp:BoundField> <asp:BoundField DataField="ACCCode" HeaderText="ACC Code" SortExpression="ACCCode" > <HeaderStyle CssClass="gridView_th" /> <ItemStyle CssClass="gridView_th" /> </asp:BoundField> <asp:BoundField DataField="ClaimNumber" HeaderText="Claim Number" SortExpression="ClaimNumber" > <HeaderStyle CssClass="gridView_th" /> <ItemStyle CssClass="gridView_th" /> </asp:BoundField> <asp:BoundField DataField="ACCPurchaseOrder" HeaderText="ACC Purchase Order" SortExpression="ACCPurchaseOrder" /> <asp:BoundField DataField="PriorApproval" HeaderText="Prior Approval" SortExpression="PriorApproval" /> <asp:BoundField DataField="PolicyNumber" HeaderText="Policy Number" SortExpression="PolicyNumber" /> <asp:BoundField DataField="Insurer" HeaderText="Insurer" SortExpression="Insurer" /> <asp:BoundField DataField="PatientSurgeryID" HeaderText="PatientSurgeryID" InsertVisible="False" ReadOnly="True" SortExpression="PatientSurgeryID" /> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource7" runat="server" ConnectionString="<%$ ConnectionStrings:Unisports %>" SelectCommand="SELECT * FROM [vOplistBar]"></asp:SqlDataSource> </div> <div class="header" style="width: 100%;"> <br /> <asp:Label ID="Label3" runat="server" Text="Surgeons Notes to Admin - Please Complete" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" Width="100%"></asp:Label> </div> <div class="form1"> <asp:FormView ID="FormView2" runat="server" DefaultMode="Edit" Width="108%" DataKeyNames="PatientSurgeryID" DataSourceID="SqlDataSource3" OnItemUpdated="ItemUpdated_refreshSQLDS1" OnPageIndexChanging="FormView2_PageIndexChanging" > <EditItemTemplate> <div class="con1"> <div class="serviceBox16"> Surgeon Fee: </div> <div class="serviceBox16"> New Core Codes: </div> <div class="serviceBox16"> Implants Used: </div> <div class="serviceBox16"> Image Intensifier Minutes: </div> <div class="serviceBox16"> Assistant Surgeon Name: </div> <div class="serviceBox16"> ESR01_02 - Extra theatre time minutes: </div> <div class="serviceBox16" style="height: 70px; line-height:normal;"> <p>ESR04 - Position change - 2 units</p><p style="font-style:italic;"> (any position which is not supine or lateral)</p> </div> <div class="serviceBox16"> ESR05 - Additional ward stay Nights: </div> <div class="serviceBox16"> Surgeons Comment: </div> <br /> <br /> </div> <div class="con2"> <div class="serviceBox16"> <asp:TextBox ID="SurgeonFeeTextBox" runat="server" autocomplete="off" Style="text-align: left;" Width="90%" Text='<%# Bind("SurgeonFee","{0:#####0.00}") %>' /> </div> <div class="serviceBox16"> <asp:TextBox ID="NewCoreCodesTextBox" runat="server" autocomplete="off" Style="text-align: left;" Width="90%" Text='<%# Bind("NewCoreCodes") %>' /> </div> <div class="serviceBox16"> <asp:CheckBox ID="ImplantsUsedCheckBox" runat="server" autocomplete="off" Checked='<%# Bind("ImplantsUsed") %>' BorderStyle="None" BorderColor="White" Text=" " Height="33px" OnCheckedChanged="ImplantsUsed_checkChanged" /> </div> <div class="serviceBox16"> <asp:TextBox ID="ImageIntensifierMinutesTextBox" runat="server" autocomplete="off" Style="text-align: left;" Width="50%" Text='<%# Bind("ImageIntensifierMinutes") %>' /> </div> <div class="serviceBox16"> <asp:DropDownList ID="AssistantSurgeonNameDDL" runat="server" Style="text-align: left;" Width="100%" DataSourceID="SqlDataSource9" DataValueField ="AsstSurgeonName" DataTextField ="AsstSurgeonName" 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> <br /> <br /> <div class="ServiceBox16" style="height: 55px;"> <asp:TextBox ID="TextBox1" runat="server" Style="text-align: left;" autocomplete="off" Width="100%" Text='<%# Bind("ESR05") %>' /> </div> <div style="width:200%;"> <div class="serviceBox16"> <asp:TextBox ID="SurgeonsCommentTextBox" runat="server" Style="text-align: left;" autocomplete="off" Width="100%" TextMode="MultiLine" Text='<%# Bind("SurgeonsComment") %>' /> </div> </div> <div class="serviceBox16"> <br /> <br /> <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" onitemcommand="itemCommandClick" CommandName="Update" Text="Save Draft" /> <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> <br /> <br /> <asp:Button ID="Button1" runat="server" Font-Bold="True" Font-Size="Large" Height="47px" UseSubmitBehavior="false" OnClick="Button1_Click" Text="Ready to Send" Width="166px" /> </div> </div> </EditItemTemplate> </asp:FormView> </div> <div class="rightcon"> <br /> Implant <asp:DropDownList ID="ddl1" runat="server" DataSourceID="SqlDataSource2" DataTextField="ImplantName" DataValueField="ipid" OnLoad="ddl1_Load1" OnSelectedIndexChanged="ddl1_SelectedIndexChanged"> </asp:DropDownList> Qty <asp:TextBox ID="TextBox2" runat="server" Width="30px"></asp:TextBox> <asp:Button ID="Button2" runat="server" Text="Add" OnClick="Button2_click" /> <br /> <br /> <br /> <br /> <div class="rightcon2"> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="iuid" DataSourceID="SqlDataSource4" style="margin-bottom: 0px" > <Columns> <asp:BoundField DataField="iuid" HeaderText="iuid" InsertVisible="False" ReadOnly="True" SortExpression="iuid" Visible="False" /> <asp:BoundField DataField="ipid" HeaderText="ipid" SortExpression="ipid" Visible="False" /> <asp:BoundField DataField="SurgeonID" HeaderText="SurgeonID" SortExpression="SurgeonID" Visible="False" /> <asp:BoundField DataField="PatientSurgeryID" HeaderText="PatientSurgeryID" SortExpression="PatientSurgeryID" Visible="False" /> <asp:BoundField DataField="QuantityUsed" HeaderText="Quantity" SortExpression="QuantityUsed" > <HeaderStyle HorizontalAlign="Center" CssClass="gridViewRow" Width="150px" /> </asp:BoundField> <asp:BoundField DataField="ImplantName" HeaderText="Implant" SortExpression="ImplantName" > <HeaderStyle HorizontalAlign="Center" CssClass="gridViewRow" /> <ItemStyle Width="200px" VerticalAlign="Top" /> </asp:BoundField> <asp:CommandField ShowDeleteButton="True" > <ControlStyle CssClass="focus" /> <HeaderStyle CssClass="gridViewRow" Width="100px" /> </asp:CommandField> </Columns> </asp:GridView> <br /> </div> <div> <asp:Button ID="frmAddImplant" runat="server" OnClick="AddImplant_Click" Text="Add New Implant" /> </div> </div> <div style="width: 100%;"> <asp:SqlDataSource ID="SqlDataSource1" runat="server" OnSelecting="SqlDataSource1_Selecting" ConnectionString="<%$ ConnectionStrings:Unisports %>" SelectCommand="SELECT [ACCCode], [Side], [ClaimNumber], [PolicyNumber], [Insurer], [ACCPurchaseOrder], [PriorApproval] FROM [vSurgeryList] WHERE ([PatientSurgeryID] = @PatientSurgeryID)"> <SelectParameters> <asp:SessionParameter DefaultValue="7519" Name="PatientSurgeryID" SessionField="sid" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:Unisports %>" SelectCommand="SELECT * FROM [tblImplants] WHERE SurgeonID = @CurrentSurgeonID" DeleteCommand="DELETE FROM [tblImplants] WHERE WHERE [ipid] = @ipid" InsertCommand="INSERT INTO [tblImplants] ([ImplantCode], [ImplantName], [Location], [SurgeonID], [Quantity]) VALUES (@ImplantCode, @ImplantName, @Location, @SurgeonID, @Quantity)" UpdateCommand="UPDATE [tblImplants] SET [ImplantCode] = @ImplantCode, [ImplantName] = @ImplantName, [Location] = @Location, [SurgeonID] = @SurgeonID, [Quantity] = @Quantity WHERE [ipid] = @ipid" > <SelectParameters> <asp:QueryStringParameter DefaultValue="5" Name="CurrentSurgeonID" QueryStringField="SurgeonID" /> </SelectParameters> <DeleteParameters> <asp:Parameter Name="ipid" Type="Int32" /> </DeleteParameters> <InsertParameters> <asp:Parameter Name="ImplantCode" Type="String" /> <asp:Parameter Name="ImplantName" Type="String" /> <asp:Parameter Name="Location" Type="String" /> <asp:Parameter Name="SurgeonID" Type="Int32" /> <asp:Parameter Name="Quantity" Type="Int32" /> </InsertParameters> <UpdateParameters> <asp:Parameter Name="ImplantCode" Type="String" /> <asp:Parameter Name="ImplantName" Type="String" /> <asp:Parameter Name="Location" Type="String" /> <asp:Parameter Name="SurgeonID" Type="Int32" /> <asp:Parameter Name="Quantity" Type="Int32" /> <asp:Parameter Name="ipid" Type="Int32" /> </UpdateParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:Unisports %>" SelectCommand="SELECT [PatientSurgeryID], [SurgeonFee], [NewCoreCodes], [ImplantsUsed], [ImageIntensifierMinutes], [AssistantSurgeonName], [ESR04], [ESR05], [ESR01_02], [SurgeonsComment] FROM [tblPatients_Surgery] WHERE [PatientSurgeryID] = @sid" DeleteCommand="DELETE FROM [tblPatients_Surgery] WHERE [PatientSurgeryID] = @PatientSurgeryID" InsertCommand="INSERT INTO [tblPatients_Surgery] ([SurgeonFee], [NewCoreCodes], [ImplantsUsed], [ImageIntensifierMinutes], [AssistantSurgeonName], [ESR04], [ESR05], [ESR01_02], [SurgeonsComment]) VALUES (@SurgeonFee, @NewCoreCodes, @ImplantsUsed, @ImageIntensifierMinutes, @AssistantSurgeonName, @ESR04, @ESR05, @ESR01_02, @SurgeonsComment)" UpdateCommand="UPDATE [tblPatients_Surgery] SET [SurgeonFee] = @SurgeonFee, [NewCoreCodes] = @NewCoreCodes, [ImplantsUsed] = @ImplantsUsed, [ImageIntensifierMinutes] = @ImageIntensifierMinutes, [AssistantSurgeonName] = @AssistantSurgeonName, [ESR04] = @ESR04, [ESR05] = @ESR05, [ESR01_02] = @ESR01_02, [SurgeonsComment] = @SurgeonsComment WHERE [PatientSurgeryID] = @PatientSurgeryID"> <SelectParameters> <asp:SessionParameter Name="sid" Type="Int32" SessionField="sid" /> </SelectParameters> <DeleteParameters> <asp:Parameter Name="PatientSurgeryID" Type="Int32" /> </DeleteParameters> <InsertParameters> <asp:Parameter Name="SurgeonFee" Type="Decimal" /> <asp:Parameter Name="NewCoreCodes" Type="String" /> <asp:Parameter Name="ImplantsUsed" Type="Boolean" /> <asp:Parameter Name="ImageIntensifierMinutes" Type="Int32" /> <asp:Parameter Name="AssistantSurgeonName" Type="String" /> <asp:Parameter Name="ESR04" Type="String" /> <asp:Parameter Name="ESR05" Type="Int32" /> <asp:Parameter Name="ESR01_02" Type="Int32" /> <asp:Parameter Name="SurgeonsComment" Type="String" /> </InsertParameters> <UpdateParameters> <asp:Parameter Name="SurgeonFee" Type="Decimal" /> <asp:Parameter Name="NewCoreCodes" Type="String" /> <asp:Parameter Name="ImplantsUsed" Type="Boolean" /> <asp:Parameter Name="ImageIntensifierMinutes" Type="Int32" /> <asp:Parameter Name="AssistantSurgeonName" Type="String" /> <asp:Parameter Name="ESR04" Type="String" /> <asp:Parameter Name="ESR05" Type="Int32" /> <asp:Parameter Name="ESR01_02" Type="Int32" /> <asp:Parameter Name="SurgeonsComment" Type="String" /> <asp:Parameter Name="PatientSurgeryID" Type="Int32" /> </UpdateParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:Unisports %>" DeleteCommand="DELETE FROM tblPatientsSurgeryImplantsUsed WHERE (iuid = @iuid)" SelectCommand="SELECT tblPatientsSurgeryImplantsUsed.iuid, tblPatientsSurgeryImplantsUsed.ipid, tblPatientsSurgeryImplantsUsed.SurgeonID, tblPatientsSurgeryImplantsUsed.PatientSurgeryID, tblPatientsSurgeryImplantsUsed.QuantityUsed, tblImplants.ImplantName FROM tblImplants INNER JOIN tblPatientsSurgeryImplantsUsed ON tblImplants.ipid = tblPatientsSurgeryImplantsUsed.ipid"> <DeleteParameters> <asp:Parameter Name="iuid" /> </DeleteParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource9" runat="server" ConnectionString="<%$ ConnectionStrings:Unisports %>" SelectCommand="SELECT * FROM [tblAsstSurgeonName]"></asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource8" runat="server" ConnectionString="<%$ ConnectionStrings:Unisports %>" SelectCommand="SELECT * FROM [tblPositionChange] "></asp:SqlDataSource> </div> <div style= "vertical-align:bottom; "Width:100%;"><br /></div> </asp:Content>
Что я уже пробовал:
Я пробовал много решений, опубликованных в качестве ответа на эту проблему, но ничего не работает, я не понимаю, как страница работает нормально, как обновление полей, выпадающие списки связаны, но когда я либо нажимаю на кнопку выхода из системы, либо нажимаю на кнопку добавления, чтобы добавить имплантаты в сетку, она сообщает об ошибке
"
databinding methods such as eval(), xpath(), and bind() can only be used in the context of a data-bound control."
Единственное, что может прийти в голову моему явно необученному уму,-это то, что два выпадающих списка привязаны к таблице, в которую будут сохранены данные, пока список заполняется для другой таблицы через sqldatasource.
Любая помощь в этом деле была бы очень кстати.
DerekT-P
Поскольку это происходит только при выходе из системы, было бы полезно, если бы вы включили любой код, участвующий в процессе выхода из системы!
Member 14560926
Мой процесс выхода из системы-это выход из коробки vs2019, который создается при запуске веб-сайта. таким образом, это стандартный процесс аутентификации. Эта проблема возникает только при выходе из системы с этой страницы.
DerekT-P
Итак, какое действие выхода вы указываете? Вы говорите: "все, что он делает, это закрывается", так что это означает, что вы делаете что-то дополнительное, а не просто очищаете билет аутентификации. (Какой метод аутентификации вы используете?)
Member 14560926
Я не вносил никаких изменений ни в одну процедуру выхода из системы, которую я использую, как я подозреваю, чтобы быть
использование Microsoft.сеть САШ.Идентичность.Долг;
это находится на странице login.aspx. Я сделал некоторые изменения на странице входа в систему, которые создали некоторые переменные сеанса.