0

我正在使用DevExpress ASPxGridView編輯表單,使用默認編輯表單。然而,當我在IE6中打開編輯表單並單擊「更新」來插入記錄時,它會導致一個JavaScript錯誤,指出「類型」爲空或不是對象「,但它在IE7中正常工作。如何解決這個問題。代碼如下。當打開ASPxGridView編輯表單時,IE6中的JavaScript錯誤

<dx:ASPxGridView ID="ASPxGridView_JobTitles" runat="server" 
    AutoGenerateColumns="False" Caption="Titles" 
    ClientInstanceName="ASPxClientGridView_Titles" 
    DataSourceID="SqlDataSource_JobTitle" KeyFieldName="Title" Width="500px"> 
    <Settings UseFixedTableLayout="True" /> 
    <Columns> 
     <dx:GridViewCommandColumn ButtonType="Image" Caption=" " VisibleIndex="0" 
      Width="65px"> 
      <UpdateButton Visible="True"> 
       <Image Url="~/images/update.png"> 
       </Image> 
      </UpdateButton> 
      <CancelButton Visible="True"> 
       <Image Url="~/images/cancel.png"> 
       </Image> 
      </CancelButton> 
      <EditButton> 
       <Image Url="~/images/file_edit.png"> 
       </Image> 
      </EditButton> 
      <HeaderTemplate> 
       <dx:ASPxButton ID="ASPxButton_New0" runat="server" AutoPostBack="false" 
        Image-Url="~/images/file_add.png" Text="New"> 
        <ClientSideEvents Click="function(s,e){ASPxClientGridView_Titles.AddNewRow();}" /> 
       </dx:ASPxButton> 
      </HeaderTemplate> 
     </dx:GridViewCommandColumn> 
     <dx:GridViewDataTextColumn FieldName="Title" VisibleIndex="1"> 
      <PropertiesTextEdit> 
       <ValidationSettings CausesValidation="True"> 
        <RequiredField ErrorText="Is Required" IsRequired="True" /> 
       </ValidationSettings> 
      </PropertiesTextEdit> 
     </dx:GridViewDataTextColumn> 
     <dx:GridViewCommandColumn ButtonType="Image" Caption=" " VisibleIndex="2" 
      Width="65px"> 
      <DeleteButton Visible="True"> 
       <Image Url="~/images/file_delete.png"> 
       </Image> 
      </DeleteButton> 
     </dx:GridViewCommandColumn> 
    </Columns> 
    <SettingsBehavior ConfirmDelete="True" /> 
</dx:ASPxGridView> 
<asp:SqlDataSource ID="SqlDataSource_Title" runat="server" 
    ConnectionString="<%$ ConnectionStrings:TEST %>" 
    SelectCommand="SELECT [Title] FROM [Titles]" 
    UpdateCommand="UPDATE Titles SET Title = @Title WHERE (Title = Title)" 
    DeleteCommand="DELETE FROM Titles WHERE (Title = @Title)" 
    InsertCommand="INSERT INTO Titles(Title) VALUES (@Title)"> 
    <InsertParameters> 
     <asp:Parameter Name="Title" Type="String" /> 
    </InsertParameters> 
    <UpdateParameters> 
     <asp:Parameter Name="Title" Type="String" /> 
    </UpdateParameters> 
</asp:SqlDataSource> 

回答

0

您所使用的代碼是非常正確的,我沒有看到一個原因這個錯誤的出現。請告訴您使用哪個ASPxGridView版本?有沒有可能你使用最新的(10.1.5)?

相關問題