Microsoft JScript Runtime Error: Object Expected
Here is my code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="TrackingAdministration.aspx.vb" Inherits="TrackingAdministration"
EnableViewState = "false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" language="javascript">
document.getElementById("trackingGridView").
function test( sender)
{
//alert(sender);
var arr = document.getElementById(sender).childNodes
for( i = 0; i < arr.length; ++i)
{
if(arr[i].value == " " )
{
arr[i].value = "" ;
alert(i);
}
}
// alert(arr[1].innerHTML + " " + arr[2].innerHTML + " " + arr[3].innerHTML + " " + arr[4].innerHTML + " " + arr[5].innerHTML + " " + arr[6].innerHTML + " " + arr[7].innerHTML + " " + arr[8].innerHTML);
document.getElementById("laundryUIDUTextBox").value = arr[1].innerHTML;
document.getElementById("invoiceDateTextBox").value = arr[2].innerHTML;
//document.getElementById("statusIDDropDownList1").value = arr[3].innerHTML;
//document.getElementById("employeeUIDTextBox").value = arr[4].innerHTML;
document.getElementById("customerUIDTextBox").value = arr[3].innerHTML;
document.getElementById("entryDateTextBox").value = arr[4].innerHTML;
document.getElementById("tagIDTextBox").value = arr[5].innerHTML;
//document.getElementById("statusIDDropDownList2").value = arr[7].innerHTML;
document.getElementById("quantityTextBox").value = arr[6].innerHTML;
document.getElementById("typeIdDropDownList").value = arr[7].innerHTML;
document.getElementById("releaseDateTextBox").value = arr[8].innerHTML;
//document.getElementById("machineIDDropDownList").value = arr[12].innerHTML;
document.getElementById("laundryUIDTextBox3").value = arr[9].innerHTML;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
<br />
<br />
<asp:Label ID="Label1" runat="server" Text="LaundryUid" Width="74px"></asp:Label>
<asp:TextBox ID="laundryUIDTextBox" runat="server"></asp:TextBox>
<asp:Button ID="laundryTrackingButton" runat="server" Text="Track" /><br />
<br />
<br />
<br />
<br />
<asp:Panel ID="Panel1" runat="server" Height="235px" ScrollBars="Both" Width="786px">
<asp:Label ID="Label2" runat="server" Text="LaundryUid"></asp:Label><asp:TextBox
ID="laundryUIDUTextBox" runat="server" Width="130px"></asp:TextBox><asp:Label ID="Label3"
runat="server" Text="InvoiceDate"></asp:Label><asp:TextBox ID="invoiceDateTextBox"
runat="server" ToolTip="Please enter the date in the format MM/dd/yyyy:hh:mm"></asp:TextBox><asp:Label
ID="Label4" runat="server" Text="StatusId"></asp:Label><asp:DropDownList ID="statusIDDropDownList1"
runat="server" DataSourceID="SqlDataSource2" DataTextField="StatusName" DataValueField="StatusID"></asp:DropDownList><asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:LaundrySystemConnectionString2 %>"
SelectCommand="SELECT [StatusID], [StatusName] FROM [Status]"></asp:SqlDataSource>
<br />
<br />
<asp:Label ID="Label5" runat="server" Text="EmployeeUID"></asp:Label><asp:TextBox
ID="employeeUIDTextBox" runat="server"></asp:TextBox>
<asp:Label ID="Label6" runat="server" Text="CustomerUid"></asp:Label><asp:TextBox
ID="customerUIDTextBox" runat="server"></asp:TextBox>
<asp:Label ID="Label7" runat="server" Text="EntryDate"></asp:Label><asp:TextBox ID="entryDateTextBox"
runat="server"></asp:TextBox> <br />
<br />
<asp:Button ID="deltePButton" runat="server" Text="Delete" />
<asp:Button ID="updateMasterButton" runat="server" Text="Updpate" />
<asp:Button ID="newPButton" runat="server" Text="New" /><br />
<br />
<br />
<br />
<asp:Label ID="Label8" runat="server" Text="TagId"></asp:Label>
<asp:TextBox ID="tagIDTextBox" runat="server"></asp:TextBox>
<asp:Label ID="Label9" runat="server" Text="StatusID"></asp:Label> <asp:DropDownList
ID="statusIDDropDownList2" runat="server" DataSourceID="SqlDataSource3" DataTextField="StatusName"
DataValueField="StatusID">
</asp:DropDownList>
<asp:Label ID="Label10" runat="server" Text="Quantity"></asp:Label>
<asp:TextBox ID="quantityTextBox" runat="server"></asp:TextBox>
<br />
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:LaundrySystemConnectionString2 %>"
SelectCommand="SELECT [StatusName], [StatusID] FROM [Status]"></asp:SqlDataSource>
<br />
<asp:Label ID="Label11" runat="server" Text="TypeID"></asp:Label> <asp:DropDownList
ID="typeIdDropDownList" runat="server" DataSourceID="SqlDataSource4" DataTextField="TypeName"
DataValueField="TypeID">
</asp:DropDownList>
<asp:Label ID="Label12" runat="server" Text="ReleaseDate"></asp:Label>
<asp:TextBox ID="releaseDateTextBox" runat="server"></asp:TextBox>
<asp:Label ID="Label13" runat="server" Text="MachineID"></asp:Label>
<asp:DropDownList ID="machineIDDropDownList" runat="server" DataSourceID="SqlDataSource5"
DataTextField="Name" DataValueField="MachineID">
</asp:DropDownList> <br />
<br />
<br />
<asp:Label ID="Label14" runat="server" Text="LaundryUID"></asp:Label>
<asp:TextBox ID="laundryUIDTextBox3" runat="server"></asp:TextBox>
<asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:LaundrySystemConnectionString2 %>"
SelectCommand="SELECT [MachineID], [Name] FROM [Machine]"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:LaundrySystemConnectionString %>"
SelectCommand="SELECT [TypeID], [TypeName] FROM [ItemTypes]"></asp:SqlDataSource>
<br />
<br />
<asp:Button ID="deleteButton2" runat="server" Text="Delete" /><asp:Button ID="updateButton2"
runat="server" Text="Update" /><asp:Button ID="newButton2" runat="server" Text="New" /><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</asp:Panel>
<br />
<asp:Button ID="updateButton" runat="server" Text="Update" /><asp:Button ID="newButton"
runat="server" Text="New" /><asp:Button ID="deleteButton" runat="server" Text="Delete" />
<asp:Button ID="customerRegistrationButton" runat="server" Text="Register Customer" /><br />
<br />
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:LaundrySystemConnectionString2 %>"
InsertCommand="INSERT INTO MasterLaundry (LaundryUID, InvoiceDate, StatusID, EmployeeUID, CustomerUID, EntryDate) VALUES (@LaundryUID, @InvoiceDate, @StatusID, @EmployeeUID, @CustomerUID, @EntryDate);
INSERT INTO DetailsLaundry (TagID,
StatusID, Quantity, TypeID, ReleaseDate, MachineID, LaundryUID) VALUES (@TagID, @StatusID, @Quantity, @TypeID, @ReleaseDate, @MachineID, @LaundryUID); "
SelectCommand="SELECT MasterLaundry.LaundryUID, MasterLaundry.InvoiceDate, MasterLaundry.CustomerUID, MasterLaundry.EntryDate,DetailsLaundry.TagID, DetailsLaundry.Quantity, ItemTypes.TypeName, DetailsLaundry.ReleaseDate FROM MasterLaundry
INNER
JOIN DetailsLaundry ON DetailsLaundry.LaundryUID = MasterLaundry.LaundryUID
INNER JOIN ItemTypes ON DetailsLaundry.TypeID = ItemTypes.TypeID WHERE MasterLaundry.LaundryUID = @LaundryUID"
UpdateCommand="UPDATE MasterLaundry SET InvoiceDate=@InvoiceDate, StatusID=@StatusID, EmployeeUID=@EmployeeUID, CustomerUID=@CustomerUID, EntryDate=@EntryDate;
UPDATE DetailsLaundry SET StatusID = @StatusID, Qunatity=@Quantity, TypeID=@TypeID,
ReleaseDate=@ReleaseDate, MachineID=@MachineID, LaundryUID=@LaundryUID;" DeleteCommand="DELETE * FROM MasterLaundry WHERE LaundryUID = @LaundryUID;
DELETE * FROM DetailsLaundry WHERE LaundryUID = @TagID;">
<SelectParameters>
<asp:SessionParameter Name="LaundryUID" SessionField="LaundryUID" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="InvoiceDate" />
<asp:Parameter Name="StatusID" />
<asp:Parameter Name="EmployeeUID" />
<asp:Parameter Name="CustomerUID" />
<asp:Parameter Name="EntryDate" />
<asp:Parameter Name="Quantity" />
<asp:Parameter Name="TypeID" />
<asp:Parameter Name="ReleaseDate" />
<asp:Parameter Name="MachineID" />
<asp:Parameter Name="LaundryUID" />
</UpdateParameters>
<InsertParameters>
<asp:ControlParameter ControlID="DetailsView1" Name="LaundryUID" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="DetailsView1" Name="InvoiceDate" PropertyName="SelectedValue"
Type="DateTime" />
<asp:ControlParameter ControlID="DetailsView1" Name="StatusID" PropertyName="SelectedValue"
Type="Int32" />
<asp:ControlParameter ControlID="DetailsView1" Name="EmployeeUID" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="DetailsView1" Name="CustomerUID" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="DetailsView1" Name="EntryDate" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="DetailsView1" Name="TagID" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="DetailsView1" Name="Quantity" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="DetailsView1" Name="TypeID" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="DetailsView1" Name="ReleaseDate" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="DetailsView1" Name="MachineID" PropertyName="SelectedValue" />
</InsertParameters>
<DeleteParameters>
<asp:Parameter Name="LaundryUID" />
<asp:Parameter Name="TagID" />
</DeleteParameters>
</asp:SqlDataSource>
<asp:Label ID="Label15" runat="server" Width="708px"></asp:Label>
<asp:GridView ID="trackingGridView" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="LaundryUID" HeaderText="LaundryUID" SortExpression="LaundryUID" />
<asp:BoundField DataField="InvoiceDate" HeaderText="InvoiceDate" SortExpression="InvoiceDate" />
<asp:BoundField DataField="CustomerUID" HeaderText="CustomerUID" SortExpression="CustomerUID" />
<asp:BoundField DataField="EntryDate" HeaderText="EntryDate" SortExpression="EntryDate" />
<asp:BoundField DataField="TagID" HeaderText="TagID" SortExpression="TagID" />
<asp:BoundField DataField="Quantity" HeaderText="Quantity" SortExpression="Quantity" />
<asp:BoundField DataField="TypeName" HeaderText="TypeName" SortExpression="TypeName" />
<asp:BoundField DataField="ReleaseDate" HeaderText="ReleaseDate" SortExpression="ReleaseDate" />
<asp:ButtonField ButtonType="Button" Text="Load records" />
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>
Posted: Oct 25, 2009 06:25 AM
View 5 Replies!
View Related