iFrame中的大表崩溃了IE8

时间:2010-06-02 14:57:01

标签: asp.net crash internet-explorer-8

我有一个包含iFrame的页面,其源代码是ashx页面。处理程序通过查询字符串接受3个参数,并生成包含表的text / html响应。当表格获得> 1700行时,它会崩溃IE8浏览器。浏览器冻结并返回空引用错误。

如果我将正在渲染的html放在页面上的DIV中,它在IE8中渲染得很好。有什么建议吗?

3 个答案:

答案 0 :(得分:4)

崩溃是由名为SmartScreen的IE8功能引起的。它可以防止用户导航到已知的恶意软件和网络钓鱼站点。它也是一种非预期的功能,可以防止网站在渲染后删除大量数据。一旦关闭此功能,崩溃就会完全消失。

答案 1 :(得分:0)

[更新]从您的评论中,我不认为问题是大表。因此,这个答案不适用,但我会离开它,因为看起来这个问题在SO上出现了很多次。

尝试“兼容性视图”,同样的问题?

尝试缩小页面大小。例如,

  1. 剥去不必要的空白区域(先做因为最容易)
  2. 临时使用多次使用规则的两个字符的css规则名称,
  3. temporarilly使用两个或三个字符的控件名称和控件ID,用于在类似转发器的控件中使用的控件,例如数据列表,网格等。

  4. 注释

    Public Class SearchPage
        Inherits System.Web.UI.Page
    
        'NOTE
        'short names for variables, controls, and so on, are specifically to reduce file size.
    
        'used 69,106 records for 
        '       testing/development (this will increase by 10,000 per month)
        'limited to 10,000 records for production (customer rarely will have more than 10,000 and only a few will always have 10,000+)
    
        Private Const DefaultResultLimit As Integer = 10000
        Private Const CheckPoint As Integer = 100
    
    
        Private Sub PopulateSearchResults(ByVal oResults As DataTable)
            Dim iCount As Integer
    
            For Each oRow As DataRow In oResults.Rows
    
                AddTableRow(tblBOM, New BomInfo(oRow))
    
                iCount += 1
                If (iCount Mod CheckPoint) = 0 Then
                    If Not Me.Response.IsClientConnected Then
                        Exit For
                    End If
                End If
                If iCount > Me.ResultLimit Then
                    'limit results
                    Exit For
                End If
            Next
    
        End Sub
    
    
        Private Sub AddTableRow(ByVal table As Table, ByVal bom As BomInfo)
    
            'NOTE
            'short names for variables, controls, and so on, are specifically to reduce file size.
    
            Dim oRow As New TableRow
    
            oRow.CssClass = "btr"
    
            oRow.Cells.Add(CreateCell(New HighlightControl(bom.ManufacturerName, _searchTerm, "sv"), "btc"))
            oRow.Cells.Add(CreateCell(New HighlightControl(bom.Mpn, _searchTerm, "sv"), "btc"))
            oRow.Cells.Add(CreateCell(New HighlightControl(bom.PartDescription, _searchTerm, "sv"), "btc"))
            oRow.Cells.Add(CreateCell(New HighlightControl(bom.Markings, _searchTerm, "sv"), "btc"))
    
            oRow.Cells.Add(CreateCell(bom.IcLength, "btc cntr"))
            oRow.Cells.Add(CreateCell(bom.IcWidth, "btc cntr"))
            oRow.Cells.Add(CreateCell(bom.PackageType, "btc cntr"))
            oRow.Cells.Add(CreateCell(bom.PinCount, "btc cntr"))
            oRow.Cells.Add(CreateCell(FormatCurrency(bom.ComponentPrice), "btch cr"))
            oRow.Cells.Add(CreateCell(FormatCurrency(bom.ComponentTotal), "btc cr"))
            oRow.Cells.Add(CreateCell(bom.Quantity, "btc cntr"))
            oRow.Cells.Add(CreateCell(bom.ReleaseDate, "btc cr"))
            oRow.Cells.Add(CreateCell(bom.ModelInfo, "btc"))
            oRow.Cells.Add(CreateCell(bom.ComponentFunction, "btc"))
    
            table.Rows.Add(oRow)
    

    End Sub

        '...
        ElseIf oResults.Rows.Count > Me.ResultLimit Then
            'only display the records up to the limit
            'then notify user
            __recordLimitWarning.Text = " " + String.Format(Me.ResultLimitText, Me.ResultLimit.ToString("N0"))
            __recordLimitWarning.Visible = True
    
        End If
        '....
    

答案 2 :(得分:0)

  

如果我将正在渲染的html放在页面上的DIV中,它在IE8中渲染得很好。有什么建议吗?

ashx处理程序是渲染完整的html页面还是只渲染表格片段?

确保页面是带有html,body标签的有效html。

表格也冻结了大多数浏览器的布局过程。您是否尝试过使用div标签来查看它是否会崩溃IE 8