在 Webform 上加载 PDF 时,IE 隐藏菜单项

IE hide the Menu Items when PDF is loaded on Webform

我有一个菜单项。当用户单击菜单项按钮(声明)时,它会在菜单项下方打开 PDF。

问题是当我在 Internet Explorer 中加载相同的网络表单时它会打开 PDF 在代码下方,但我的菜单项列表在 PDF 后面。

这是我关于如何在 Web 表单上加载 PDF 的代码:

<iframe id="myframe" width="100%" height="600px" runat="server" frameborder="1" ></iframe>

我使用 iframe 加载 PDF。

string fileName = "IGI-Travel-Sure-Claim-Procedure.pdf";
    this.myframe.Attributes["src"] = "../uploads/pdf/" + fileName;

以上代码是在加载表单时,然后在 Web 表单上加载 PDF。

我的问题是,每当我在 Internet Explorer 中打开我的 webfrom 时,它都会将我的菜单项列表隐藏在 iframe PDF 查看器后面。同时,具有相同代码和 iframe 的相同 webform 在所有其他浏览器中都可以正常工作,例如 Chrome、FireFox、Opera 和 Edge,但在 Internet Explorer 11 中则不行。 该应用程序是在 framework 2.0 中开发的 检查此图像

This also help you to understand my issue

在寻找这个问题的答案后,我深入挖掘了一些我如何能够找到它的答案。 希望遇到这个问题的也能从我的回答中得到解决

在我的 <iframe> 上应用了简单的 CSS 来显示 PDF。 应用的简单 CSS 是

 #Iframe-Master-CC-and-Rs {
  max-width: 100%;
  max-height: 100%; 
  overflow: hidden;
}

/* inner wrapper: make responsive */
.responsive-wrapper {
  position: relative;
  height: 0;    /* gets height from padding-bottom */

  /* put following styles (necessary for overflow and scrolling handling on mobile devices) inline in .responsive-wrapper around iframe because not stable in CSS:
    -webkit-overflow-scrolling: touch; overflow: auto; */

}

.responsive-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  margin: 0;
  padding: 0;
  border: none;
}

/* padding-bottom = h/w as % -- sets aspect ratio */
/* YouTube video aspect ratio */
.responsive-wrapper-wxh-572x612 {
  padding-bottom: 107%;

}

这是代码

<div class="responsive-wrapper responsive-wrapper-wxh-572x612">
<iframe src="yourpdflink.pdf" style="width:100%; height:100%;" frameborder="0"></iframe></div>

现在在每个浏览器上都可以正常工作,如果仍然没有解决问题评论来讨论。