The page works great, can edit and save, move back to home or another page from menu bar but can not log off from page or automatically log off from page, just get the error message, if I continue it goes back to the log of page and all is good again
The problem arose when I put the two dropdownlists into the formview
here is the code
<%@ 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>
<%----%>
</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>
<%----%>
</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>
What I have tried:
I have tried many solutions posted as the answer to this problem but nothing seems to work, I don't understand how the page works normally like the fields update, the dropdown lists are bound but when I either click on the Log Off button or click on the add button on to add the implants to a grid it reports the error event
"
databinding methods such as eval(), xpath(), and bind() can only be used in the context of a data-bound control.
"
The only thing that my obviously unlearned mind can think of is that the two drop-down lists are bound to the table that the data will be saved to while the list is populated for another table through an sqldatasource.
Any help with this would be really great.