我有一个页面,我有一个网格(maingrid)和一个包含网格的usercontrol。
当我在maingrid中选择一个ros时,我会在usercontrols网格中显示一些信息。
现在,当我用一些列表绑定usercontrol网格时,它正在向我显示
错误Microsoft JScript runtime error: Object expected
。
我不知道它是什么,对此的任何想法都将不胜感激。
控件的代码如下:
<%@ Control Language="C#" AutoEventWireup="true" Codebehind="CompanyDetails.ascx.cs"
Inherits="BasWare.SupplierPortal.CWA.UI.UserControls.CompanyDetails" %>
<%@ Register Src="~/UserControls/DataListControl.ascx" TagName="DataListCtrl" TagPrefix="uc2" %>
<div id="divMain" runat="server">
<table class="panelContentTable" cellspacing="0" cellpadding="1" border="0">
<tr>
<td widht="80">
<table border="0" width="100%">
<tr>
<td class="firstTD">
<bw:BWRequiredFieldLabel ID="lblOrganizationID" runat="server" Text="Company number:"
meta:resourcekey="lblOrganizationID" RequiredIndicationLabelText="* "></bw:BWRequiredFieldLabel>
<br />
<div id="divOrganizationIDEdit" runat="server">
<bw:BWTextBox ID="txtOrganizationID" runat="server" CssClass="TextBox" ControlContext="Supplier"
meta:resourcekey="txtOrganizationID" RequiredPermission="ViewProfile"></bw:BWTextBox>
<bw:BWRequiredFieldValidator ID="reqValCompanyNumber" runat="server" ErrorMessageIconURL="~/images/error-message.gif"
ControlToValidate="txtOrganizationID" meta:resourcekey="reqValCompanyNumber"></bw:BWRequiredFieldValidator>
</div>
<div id="divOrganizationIDReadOnly" runat="server">
<bw:BWTextBox ID="txtOrganizationIDRO" runat="server" CssClass="TextBoxReadOnly"
ReadOnly="true"></bw:BWTextBox>
</div>
</td>
<td class="middleTD">
<bw:BWRequiredFieldLabel ID="lblCompanyName" runat="server" Text="Company Name:"
meta:resourcekey="lblCompanyName" RequiredIndicationLabelText="* "></bw:BWRequiredFieldLabel>
<br />
<div id="divCompanyNameEdit" runat="server">
<bw:BWTextBox ID="txtCompanyName" runat="server" CssClass="TextBox" RequiredPermission="EditCompanyProfile"
ControlContext="Invoice" meta:resourcekey="txtCompanyName"></bw:BWTextBox>
<bw:BWRequiredFieldValidator ID="reqValCompanyName" runat="server" ErrorMessageIconURL="~/images/error-message.gif"
ControlToValidate="txtCompanyName" meta:resourcekey="reqValCompanyName"></bw:BWRequiredFieldValidator>
</div>
<div id="divCompanyNameReadOnly" runat="server">
<bw:BWTextBox ID="txtCompanyNameRO" runat="server" CssClass="TextBoxReadOnly" ReadOnly="true"></bw:BWTextBox>
</div>
</td>
<td class="lastTD">
</td>
</tr>
<tr>
<td class="firstTD">
<bw:BWRequiredFieldLabel ID="Label1" runat="server" Text="Email:" RequiredIndicationLabelText="* "
meta:resourcekey="Label1"></bw:BWRequiredFieldLabel>
<br />
<div id="divEmailEdit" runat="server">
<bw:BWTextBox ID="txtEmail" runat="server" CssClass="TextBox" ControlContext="Users"
meta:resourcekey="txtEmail" RequiredPermission="ViewProfile"></bw:BWTextBox>
<bw:BWRequiredFieldValidator ID="reqValEmail" runat="server" ErrorMessageIconURL="~/images/error-message.gif"
ControlToValidate="txtEmail" meta:resourcekey="reqValEmail"></bw:BWRequiredFieldValidator>
</div>
<div id="divEmailReadOnly" runat="server">
<bw:BWTextBox ID="txtEmailRO" runat="server" CssClass="TextBoxReadOnly" ReadOnly="true"></bw:BWTextBox>
</div>
</td>
<td class="middleTD">
<bw:BWRequiredFieldLabel ID="Label10" runat="server" Text="Country:" meta:resourcekey="Label10" RequiredIndicationLabelText="* " /><br />
<div id="divCountryEdit" runat="server">
<uc2:DataListCtrl ID="dlCountry" runat="server" DefaultList="DefaultCountryCodes" ShowEmptyValue="true" />
<bw:BWRequiredFieldValidator ID="reqValCountryCode" runat="server" ErrorMessageIconURL="~/images/error-message.gif"
ControlToValidate="dlCountry" meta:resourcekey="reqValCountryCode"></bw:BWRequiredFieldValidator>
</div>
<div id="divCountryReadOnly" runat="server">
<bw:BWTextBox ID="txtCountryRO" runat="server" CssClass="TextBoxReadOnly" ReadOnly="true"></bw:BWTextBox>
</div>
</td>
<td class="lastTD">
</td>
</tr>
<tr>
<td class="firstTD">
<asp:Label ID="lblCompanyVATNumber" runat="server" Text="VAT number:" meta:resourcekey="lblCompanyVATNumber"></asp:Label><br />
<div id="divCompanyVATNumberEdit" runat="server">
<bw:BWTextBox ID="txtCompanyVATNumber" runat="server" CssClass="TextBox"
meta:resourcekey="txtCompanyVATNumber" RequiredPermission="ViewProfile"></bw:BWTextBox>
</div>
<div id="divCompanyVATNumberReadOnly" runat="server">
<bw:BWTextBox ID="txtCompanyVATNumberRO" runat="server" CssClass="TextBoxReadOnly" ReadOnly="true"></bw:BWTextBox>
</div>
</td>
<td class="middleTD">
<asp:Label ID="lblCompanyRCSNumber" runat="server" Text="RCS number:" meta:resourcekey="lblCompanyRCSNumber"></asp:Label><br />
<div id="divCompanyRCSNumberEdit" runat="server">
<bw:BWTextBox ID="txtCompanyRCSNumber" runat="server" CssClass="TextBox"
meta:resourcekey="txtCompanyVATNumber" RequiredPermission="ViewProfile"></bw:BWTextBox>
</div>
<div id="divCompanyRCSNumberReadOnly" runat="server">
<bw:BWTextBox ID="txtCompanyRCSNumberRO" runat="server" CssClass="TextBoxReadOnly" ReadOnly="true"></bw:BWTextBox>
</div>
</td>
<td class="lastTD"></td>
</tr>
<tr>
<td class="firstTD">
<asp:Label ID="Label3" runat="server" Text="Street:" meta:resourcekey="Label3"></asp:Label><br />
<div id="divStreetEdit" runat="server">
<bw:BWTextBox ID="txtStreet" runat="server" ControlContext="Users" CssClass="TextBox"
SkipValidation="True" meta:resourcekey="txtStreet" RequiredPermission="ViewProfile"></bw:BWTextBox>
</div>
<div id="divStreetReadOnly" runat="server">
<bw:BWTextBox ID="txtStreetRO" runat="server" CssClass="TextBoxReadOnly" ReadOnly="true"></bw:BWTextBox>
</div>
</td>
<td class="middleTD">
<asp:Label ID="Label4" runat="server" Text="Postal code:" meta:resourcekey="Label4"></asp:Label><br />
<div id="divPostalCodeEdit" runat="server">
<bw:BWTextBox ID="txtPostalCode" runat="server" ControlContext="Users" CssClass="TextBox"
SkipValidation="True" meta:resourcekey="txtPostalCode" RequiredPermission="ViewProfile"></bw:BWTextBox>
</div>
<div id="divPostalCodeReadOnly" runat="server">
<bw:BWTextBox ID="txtPostalCodeRO" runat="server" CssClass="TextBoxReadOnly" ReadOnly="true"></bw:BWTextBox>
</div>
</td>
<td class="lastTD">
</td>
</tr>
<tr>
<td class="firstTD">
<asp:Label ID="Label5" runat="server" Text="City:" meta:resourcekey="Label5"></asp:Label><br />
<div id="divCityEdit" runat="server">
<bw:BWTextBox ID="txtCity" runat="server" ControlContext="Users" CssClass="TextBox"
SkipValidation="True" meta:resourcekey="txtCity" RequiredPermission="ViewProfile"></bw:BWTextBox>
</div>
<div id="divCityReadOnly" runat="server">
<bw:BWTextBox ID="txtCityRO" runat="server" CssClass="TextBoxReadOnly" ReadOnly="true"></bw:BWTextBox>
</div>
</td>
<td class="middleTD">
<asp:Label ID="lblCompanyState" runat="server" Text="State / province:" meta:resourcekey="lblCompanyState" ></asp:Label><br />
<div id="divCompanyState" runat="server">
<bw:BWTextBox ID="txtCompanyState" runat="server" CssClass="TextBox"
SkipValidation="true" meta:resourcekey="txtState" RequiredPermission="ViewProfile" ></bw:BWTextBox>
</div>
<div id="divCompanyStateReadOnly" runat="server">
<bw:BWTextBox ID="txtCompanyStateRO" runat="server" CssClass="TextBoxReadOnly" ReadOnly="true"></bw:BWTextBox>
</div>
</td>
<td class="lastTD">
</td>
</tr>
<tr>
<td class="firstTD">
<asp:Label ID="lblCompanyPhone" runat="server" Text="Phone number:" meta:resourcekey="lblCompanyPhone"></asp:Label><br />
<div id="divCompanyPhoneEdit" runat="server">
<bw:BWTextBox ID="txtCompanyPhone" runat="server" CssClass="TextBox" ControlContext="Supplier"
meta:resourcekey="txtCompanyPhone" RequiredPermission="ViewProfile"></bw:BWTextBox>
</div>
<div id="divCompanyPhoneReadOnly" runat="server">
<bw:BWTextBox ID="txtCompanyPhoneRO" runat="server" CssClass="TextBoxReadOnly" ReadOnly="true"></bw:BWTextBox>
</div>
</td>
<td class="middleTD">
<asp:Label ID="lblCompanySite" runat="server" Text="Country:" meta:resourcekey="lblCompanySite"></asp:Label><br />
<div id="divCompanySiteEdit" runat="server">
<bw:BWTextBox ID="txtCompanySite" runat="server" CssClass="TextBox"
SkipValidation="True" meta:resourcekey="txtCompanySite" RequiredPermission="ViewProfile"></bw:BWTextBox>
</div>
<div id="divCompanySiteReadOnly" runat="server">
<bw:BWTextBox ID="txtCompanySiteRO" runat="server" CssClass="TextBoxReadOnly" ReadOnly="true"></bw:BWTextBox>
</div>
</td>
<td class="lastTD">
</td>
</tr>
<tr>
<td class="firstTD">
<asp:Label ID="lbleInvoicingAddress" runat="server" meta:resourcekey="lbleInvoicingAddress"
Text="eInvoicing address:"></asp:Label><br />
<div id="divEInvoiceEdit" runat="server">
<bw:BWTextBox ID="txteInvoicingAddress" runat="server" ControlContext="Users" CssClass="TextBox"
SkipValidation="True" meta:resourcekey="txteInvoicingAddress" RequiredPermission="ViewProfile"></bw:BWTextBox>
</div>
<div id="divEInvoiceReadOnly" runat="server">
<bw:BWTextBox ID="txteInvoicingAddressRO" runat="server" CssClass="TextBoxReadOnly"
ReadOnly="true"></bw:BWTextBox>
</div>
</td>
<td class="middleTD">
<div id="divFaxNumber" runat="server">
<asp:Label ID="lblFaxNumber" runat="server" meta:resourcekey="lblFaxNumber" Text="Fax number:"></asp:Label><br />
<div id="divFaxNumberEdit" runat="server">
<bw:BWTextBox ID="txtFaxNumber" runat="server" ControlContext="Users" CssClass="TextBox"
meta:resourcekey="txtFaxNumber" SkipValidation="True" RequiredPermission="ViewProfile"></bw:BWTextBox>
</div>
<div id="divFaxNumberReadOnly" runat="server">
<bw:BWTextBox ID="txtFaxNumberRO" runat="server" CssClass="TextBoxReadOnly" ReadOnly="true"></bw:BWTextBox>
</div>
</div>
<div id="parentCompanyControl" runat="server">
<asp:Label ID="lblParentCustomer" runat="server" meta:resourcekey="lblParentCustomer"
Text="Parent customer:"></asp:Label><br />
<bw:BWParentOrganizationPicker ID="organizationPicker" runat="server" />
</div>
</td>
<td class="lastTD">
</td>
</tr>
<tr id="supplierBankDetaisRow" runat="server">
<td class="firstTD">
<asp:Label ID="lblBankName" runat="server" meta:resourcekey="lblBankName" Text="Bank name:"></asp:Label><br />
<div id="divBankEdit" runat="server">
<bw:BWTextBox ID="txtBankName" runat="server" ControlContext="Users" CssClass="TextBox"
meta:resourcekey="txtBankName" SkipValidation="True" RequiredPermission="ViewProfile"></bw:BWTextBox>
</div>
<div id="divBankReadOnly" runat="server">
<bw:BWTextBox ID="txtBankNameRO" runat="server" CssClass="TextBoxReadOnly" ReadOnly="true"></bw:BWTextBox>
</div>
</td>
<td class="middleTD">
<asp:Label ID="lblBankAccount" runat="server" meta:resourcekey="lblBankAccount" Text="Bank account:"></asp:Label><br />
<div id="divBankAccountEdit" runat="server">
<bw:BWTextBox ID="txtBankAccount" runat="server" ControlContext="Users" CssClass="TextBox"
meta:resourcekey="txtBankAccount" SkipValidation="True" RequiredPermission="ViewProfile"></bw:BWTextBox>
</div>
<div id="divBankAccountReadOnly" runat="server">
<bw:BWTextBox ID="txtBankAccountRO" runat="server" CssClass="TextBoxReadOnly" ReadOnly="true"></bw:BWTextBox>
</div>
</td>
<td class="lastTD">
</td>
</tr>
<tr>
<td class="firstTD">
<div id="divLanguage" runat="server">
<asp:Label ID="lblLanguage" runat="server" meta:resourcekey="lblLanguage" Text="Select language:"></asp:Label><br />
<div id="divLanguageEdit" runat="server">
<bw:BWDropDownList ID="ddlLanguage" runat="server" ControlContext="Invoice" CssClass="dropDownList"
meta:resourcekey="ddlLanguage" Width="157px">
</bw:BWDropDownList>
</div>
<div id="divLanguageReadOnly" runat="server">
<bw:BWTextBox ID="txtLanguageRO" runat="server" CssClass="TextBoxReadOnly" ReadOnly="true"></bw:BWTextBox>
</div>
</div>
</td>
</tr>
<tr>
<td class="firstTD">
<div id="divAutoApprove" runat="server">
<asp:CheckBox ID="chkAutoApprove" runat="server" Text="Allow auto-approving" Checked="false"
CausesValidation="false" Enabled="true" meta:resourcekey="chkAutoApprove" />
</div>
</td>
<td class="middleTD">
</td>
<td class="lastTD" style="height: 24px">
</td>
</tr>
<tr>
<td colspan="3">
<bw:BWGridViewDynamic ID="showBankAccountGrid" CssClass="DGTable" runat="server" AutoGenerateColumns="False"
RowSelectingEnabled="True" RowStyle-CssClass="DGItem" SelectedRowStyle-CssClass="DGSelectedItem" DataKeyNames="BankAccountID,IsDefault"
FooterStyle-CssClass="DGFooterTR" EditRowStyle-CssClass="DGEditItemValidator" Visible="false">
<Columns>
<asp:TemplateField HeaderText="Bank name / SWIFT:" ItemStyle-VerticalAlign="Top" meta:resourcekey="bankNameHeaderText">
<ItemTemplate>
<asp:Label ID="lblBankName" Text='<%# Eval("BankName") %>' runat="server" Visible="true" >
</asp:Label>
</ItemTemplate>
<EditItemTemplate >
<asp:TextBox ID="bankNameTextBox" runat="server" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Bank account / IBAN:" ItemStyle-VerticalAlign="Top" meta:resourcekey="bankACNHeaderText">
<ItemTemplate>
<asp:Label ID="lblBankAccount" Text='<%# Eval("BankAccountNumber") %>' runat="server" Visible="true" >
</asp:Label>
</ItemTemplate>
<EditItemTemplate >
<asp:TextBox ID="txtBankAccountNumber" runat="server" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Default" ItemStyle-VerticalAlign="Top" meta:resourcekey="IsDefaultHeaderText">
<ItemTemplate>
<asp:CheckBox ID="chkIsDefault" runat="server" AutoPostBack="true" OnCheckedChanged="chkIsDefault_CheckedChanged">
</asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<SelectedRowStyle CssClass="DGSelectedItem" />
<HeaderStyle CssClass="DGHeaderTR" />
</bw:BWGridViewDynamic>
</td>
</tr>
</table>
</td>
<td>
<asp:Panel ID="supplierDetailsPanel" runat="server" Visible="false">
<div class="panelTitle"><asp:Label ID="lblBankAccounts" runat="server" Text="Bank Accounts:" meta:resourcekey="lblBankAccounts"></asp:Label></div>
<div class="SubToolbarBorderless">
<bw:BWButton ID="btnAddBankAccount" runat="server" ButtonCSSClass="newbutton" ButtonCSSClassDisabled="newbuttonDisabled"
ToolTip="Add New" SeparatorCSSClass="separator" SeparatorImageURL="~/images/toolbar-separator.gif"
RequiredActionPermission="None" CommandName="" ConfirmationMessage="" LabelCSSClass=""
LabelText="Add New" CausesValidation="false" meta:resourcekey="btnAddBankAccount" OnClick="btnAddBankAccount_OnClick" />
<bw:BWButton ID="btnEditBankAccount" runat="server" ButtonCSSClass="editbutton" ButtonCSSClassDisabled="editbuttonDisabled"
ToolTip="Edit Bank Details" SeparatorCSSClass="separator" SeparatorImageURL="~/images/toolbar-separator.gif"
RequiredActionPermission="None" CommandName="" ConfirmationMessage=""
LabelCSSClass="" LabelText="Edit" meta:resourcekey="btnEditBankAccount"
CausesValidation="false" OnClick="btnEditBankAccount_Click"/>
<bw:BWButton ID="btnDeleteBankAccount" runat="server" ButtonCSSClass="deletebutton"
ButtonCSSClassDisabled="deletebuttonDisabled" ToolTip="Delete selected bank account(s)"
SeparatorCSSClass="separator" SeparatorImageURL="~/images/toolbar-separator.gif"
RequiredActionPermission="None" ConfirmationMessage="" OnClientClick="" LabelCSSClass=""
LabelText="Delete" meta:resourcekey="btnDeleteBankAccount" CausesValidation="false" OnClick="btnDeleteBankAccount_OnClick" />
<bw:BWButton ID="btnSaveBankAccount" runat="server" Visible="false" ButtonCSSClass="updatebutton"
ToolTip="Update bank account" SeparatorCSSClass="separator" SeparatorImageURL="~/images/toolbar-separator.gif"
RequiredActionPermission="None" CommandName="" ConfirmationMessage="" OnClientClick="" OnClick="btnSaveBankAccount_Click" LabelText="Save"
meta:resourcekey="btnSaveBankAccount" CausesValidation="false" />
<bw:BWButton ID="btnCancelBankAccountEdit" runat="server" ButtonCSSClass="cancelbutton"
ButtonCSSClassDisabled="cancelbuttonDisabled" ToolTip="Cancel bank account editing" SeparatorCSSClass="separator"
SeparatorImageURL="~/images/toolbar-separator.gif" RequiredActionPermission="None" Visible="false"
CommandName="" ConfirmationMessage="" OnClientClick="" LabelCSSClass="" LabelText="Cancel"
meta:resourcekey="btnCancelBankAccountEdit" CausesValidation="false" OnClick="btnCancelEdit_Click" />
</div>
<bw:BWGridViewDynamic ID="grdBankAccounts" CssClass="DGTable" runat="server" AutoGenerateColumns="False"
RowSelectingEnabled="True" RowStyle-CssClass="DGItem" SelectedRowStyle-CssClass="DGSelectedItem" DataKeyNames="BankAccountID,IsDefault"
FooterStyle-CssClass="DGFooterTR" EditRowStyle-CssClass="DGEditItemValidator"
OnRowCreated ="grdBankAccounts_GridViewRowCreated" >
<Columns>
<asp:TemplateField meta:resourcekey="CustomerStatusHeader">
<headertemplate>
<bw:BWButton id="btnSelectAll" runat="server" OnClick="btnSelectAll_Click" meta:resourcekey="btnSelectAll" ButtonCSSClass="selectAllButton" ButtonCSSClassDisabled="selectAllButtonDisabled"></bw:BWButton>
<bw:BWButton id="btnUnselectAll" runat="server" OnClick="btnUnselectAll_Click" meta:resourc