0

Web ページ上にあるユーザー コントロールがあり、その Web ページは iFrame に表示されます。

フォームのソース:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="FileUploadForm.aspx.vb"
Inherits="IST.FileUploadForm" %>

<%@ Register Src="myFileUpload.ascx" TagName="myFileUpload" TagPrefix="uc1" %>

<!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></title>
  </head>
  <body>
    <form id="form1" runat="server">
      <div>
        <asp:PlaceHolder ID="ph1" runat="server"></asp:PlaceHolder>
      </div>
    </form>
  </body>
</html>

コードビハインド:

Imports System.IO

Public Class FileUploadForm
  Inherits System.Web.UI.Page

  Private WithEvents myFileUpload1 As myFileUpload

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim myUploadLocation As String

    myUploadLocation = Request.QueryString("loc")
    If myUploadLocation = Nothing Then
      myUploadLocation = Server.MapPath("~\temp")
    End If

    Dim allowed As String

    allowed = Request.QueryString("accepts")
    If allowed = Nothing Then
      allowed = ""
    End If

    myFileUpload1 = CType(Me.LoadControl("myFileUpload.ascx"), myFileUpload)
    myFileUpload1.ID = "fuOfferte"
    myFileUpload1.AllowedFiles = allowed
    myFileUpload1.FileLabelText = "File"
    myFileUpload1.NotAllowedText = "This file extention is not allowed."
    myFileUpload1.UploadButtonText = "Upload file"
    myFileUpload1.UploadLocation = myUploadLocation

    ph1.Controls.Add(myFileUpload1)

  End Sub

  Private Sub myFileUpload1_FileUploaded(file As String) Handles myFileUpload1.FileUploaded
    Session("UploadedFileName") = file
  End Sub
End Class

メインページの背後にあるコード:

pnMNCfile = New Panel
pnMNCfile.ID = "pnMNCfile"
pnMNCfile.Style("position") = "absolute"
pnMNCfile.Style("left") = "45px"
pnMNCfile.Style("top") = "30px"
pnMNCfile.Style("width") = "540px"
If Request.Browser.Browser.ToLower = "ie" = False Or (Request.Browser.Browser.ToLower = "ie" = True And CInt(Request.Browser.Version.Substring(0, 1)) > 8) Then
  pnMNCfile.Style("height") = "80px"
Else
  pnMNCfile.Style("height") = "87px"
End If
pnMNCfile.Style("z-index") = "999"
pnMNCfile.BorderStyle = BorderStyle.None
pnMNCfile.BackColor = Drawing.Color.LightGray
pnMNCfile.BorderWidth = 1
pnMNCfile.Attributes.Add("OnMouseOut", "BalloonPopupControlBehavior.hidePopup();")
pnMNC3.Controls.Add(pnMNCfile)

Dim lit As New Literal
lit.Text = "<IFRAME id=""frMNCfileUpload"" frameborder=""0"" scrolling=""auto"" allowtransparency=""true"" runat=""server"" width=""100%"" height=""100%"" src=""FileUploadForm.aspx?loc=" + CStr(Session("userfolder")) + "&accepts=xls_xlsx_doc_docx""></IFRAME>"
pnMNCfile.Controls.Clear()
pnMNCfile.Controls.Add(lit)

問題は、ページが IE9 で読み込まれると、iframe が非常に短時間 (0.5 秒未満) 表示されることです。Chrome では問題なく表示されます。iframe 領域でマウスを右クリックして更新すると、コンテンツが表示されます。

また、iframeの周りに境界線を付けてみました。表示されていない場合は、境界線も表示されません。クロムでは、境界線も見ることができます。

ここで何が起きてるの?これは IE のバグですか、それとも (より可能性が高い) 何か間違ったことをしていますか? 汚い修正は、ユーザーコントロールを使用して Web ページに自動更新を追加することです。

何かご意見は?

RG、エリック

4

1 に答える 1

1
I had the same issue with IE9 for various reasons and works with Chrome.

1. Configure Asp.net to use a cookieless session state. This might help...

    <sessionState cookieless="true" mode="InProc"></sessionState>
  </system.web>

</configuration>

or

2.

or try this too:

Response.Cache.SetCacheability(HttpCacheability.NoCache);

example:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GeneralLedgerCodeListingCustomForm.aspx.cs" Inherits="xyz.GeneralLedgerCodeListingCustomForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%
    Response.Cache.SetCacheability(HttpCacheability.NoCache);
%>
于 2013-06-19T16:57:07.160 に答える