GVKun编程网logo

IE 8中的CSS iframe问题(ie css3)

6

在本文中,我们将给您介绍关于IE8中的CSSiframe问题的详细内容,并且为您解答iecss3的相关问题,此外,我们还将为您提供关于asp.net-mvc–MVC中的SSRSReportviewer

在本文中,我们将给您介绍关于IE 8中的CSS iframe问题的详细内容,并且为您解答ie css3的相关问题,此外,我们还将为您提供关于asp.net-mvc – MVC中的SSRS Reportviewer,通过自动调整iframe以适合报告来删除iframe滚动条、c# – 嵌入iframe时,ie9中的.NET Membership.GetUser()null和iframe中的safari、css – iframe的溢出问题、div内嵌iframe问题的知识。

本文目录一览:

IE 8中的CSS iframe问题(ie css3)

IE 8中的CSS iframe问题(ie css3)

我有一个看起来完美的页面http://esolar.ca/calculator

但是当我在http://esolar.ca/how-to-profit-from-microfit/microfit-income-calculator/将其嵌入iframe时

Internet Explorer 8中的“请求评估”按钮位于左侧太远.在iframed之后,如何使iframe的内容显示相同?

最佳答案
iFrame在IE中溢出.将宽度更改为584px为我“修复”它.

有些事情可以减少这些问题:

>使用DOCTYPE避免在IE中触发怪癖模式.例如:

>使用CSS重置来减少跨浏览器的差异. Here’s a good one.
>如果所有其他方法都失败了,请使用Conditional Comments来调整IE CSS.

asp.net-mvc – MVC中的SSRS Reportviewer,通过自动调整iframe以适合报告来删除iframe滚动条

asp.net-mvc – MVC中的SSRS Reportviewer,通过自动调整iframe以适合报告来删除iframe滚动条

在iframe中呈现reportviewer时,我已经拼凑了有关消除iframe滚动条的信息,转而使用浏览器滚动条. MVC不支持在视图中呈现报表查看器,因此需要iframe.

编辑:我努力找到这个解决方案(下面),因此我想我会分享.

在aspx页面(将在iframe中呈现的页面)

$(function () {//jQuery document.ready
    // attach an event handler,whenever a 'property' of the reportviewer changes,the function will be called to adjust the height of the iframe
    Sys.Application.add_load(function () {
        $find("ReportViewer").add_propertyChanged(viewerPropertyChanged); // $.find("ReportViewer") will return the reportviewer with id "ReportViewer"
    });

    function adjustIframeSize() {
        // you can play around with these figures until your report is perfect
        var extraHeightToAvoidCuttingOffPartOfReport = 100;
        var extraWidthToAvoidCuttingOffPartOfReport = 10;

        // '#ReportViewer_fixedTable' is a portion of the report viewer that contains the actual report,minus the parameters etc
        var reportPage =  $('#ReportViewer_fixedTable');

        // get the height of the report. '#ParametersRowReportViewer' is that top part that contains parameters etc
        var newHeight = reportPage.height() + $('#ParametersRowReportViewer').height() + extraHeightToAvoidCuttingOffPartOfReport;

        // same for width
        var newWidth = reportPage.width() + extraWidthToAvoidCuttingOffPartOfReport;

        // get iframe from parent document,the rest of this function only works if both the iframe and the parent page are on the same domain    
        var reportIframe = $('#ReportViewerFrame',parent.document);

        // just make sure that nothing went wrong with the calculations,other wise the entire report Could be given a very small value for height and width,thereby hiding the report
        if(newHeight>extraHeightToAvoidCuttingOffPartOfReport)
            reportIframe.height(newHeight);
        if (newWidth > extraWidthToAvoidCuttingOffPartOfReport)
            reportIframe.width(newWidth);
    }

    function viewerPropertyChanged(sender,e) {
        // only change the iframe dimensions when 'isLoading'
        if (e.get_propertyName() == "isLoading") {
            if (!$find("ReportViewer").get_isLoading()) {
                adjustIframeSize();
            }
        }
    };
});

解决方法

在 ReportViewer for MVC中使用一组扩展解决了类似的问题.

@Html.ReportViewer(
   ViewBag.ReportViewer as Microsoft.Reporting.WebForms.ReportViewer,new { scrolling = "no" })

c# – 嵌入iframe时,ie9中的.NET Membership.GetUser()null和iframe中的safari

c# – 嵌入iframe时,ie9中的.NET Membership.GetUser()null和iframe中的safari

好吧,我很难过.这是场景:
我在远程站点的iframe中嵌入了一个.net 4.0 mvc3应用程序(razor).我有一个安全的标准会员提供商,只要我使用Chrome或Firefox,一切正常.但是,当我使用ie9(兼容模式内外)和safari(仅尝试过5.1.4)时,我在登录后尝试访问另一个控制器中的Membership.GetUser()时会收到System.NullReferenceException.

所以我在我的AccountController中成功登录并重定向到我的TravelController:

public ActionResult logon(logonModel model,string returnUrl)
{
    try
    {
        if (ModelState.IsValid)
        {
            if (MembershipService.ValidateUser(model.UserName,model.Password))
            {
                FormsService.SignIn(model.UserName,model.RememberMe);
                log.Debug("User: " + model.UserName + " logged in."); 
                return RedirectToAction("Travel","Travel");
            }
        }
    }
    catch(....

现在应用程序重定向到TravelController,它执行以下操作:

public ActionResult Travel()
{
    try
    {
        string userName = Membership.GetUser().UserName;
        ... code ...
    }
    catch(Exception ex)
    {
        throw;
    }
}

所以这一切在Chrome和Firefox中运行良好,但是当我尝试使用ie或safari运行相同的代码时,Membership对象为null.

我有一种感觉它与iframe有某种关系,但我现在第二次猜测一切.如果我在iframe之外运行它;意思是我直接调用url它在所有浏览器中运行(我已经尝试过).

有任何想法吗?
提前致谢.

解决方法

身份验证基于Cookie.如果iframe不提供机器可读的隐私政策,则Internet Explorer不允许iframe中的第三方网站使用Cookie.有关详细信息,请参见 http://www.softwareprojects.com/resources/programming/t-how-to-get-internet-explorer-to-use-cookies-inside-1612.html和 http://en.wikipedia.org/wiki/P3P.

所以你应该在网站上添加一个合适的标题,它应该可以正常工作.

希望有所帮助.

css – iframe的溢出问题

css – iframe的溢出问题

我有一个包含iframe的简单页面. iframe包含一个带有一些div的页面.当我打开嵌入式页面时,它工作得很好.应该溢出的div溢出.但是当我打开集装箱的地方不是.以下是我的代码:

集装箱页面:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
  <head>
    <Meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

    <style type="text/css">
            #content{
                margin: auto;
                width: 500px;
                height: 1000px;
                background: green;
            }

            #frame{
                width:202px; 
                height:302px; 
                overflow: visible;
            }
    </style>

  </head>

  <body>
        <div id="content">
            <iframe id="frame"
                src="http://localhost:8080/webApp/view/test/embeddable.html" 
                scrolling="no" frameborder="0" allowTransparency="true" marginheight="0" marginwidth="0">
            </iframe>           
        </div>
  </body>
</html>

可嵌入页面:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
  <head>
    <style type="text/css">
        body {
            width: 200px;
            height: 300px;
            overflow: visible;
            border: 1px solid yellow;
        }

            #id1{
                margin: auto;
                width: 500px;
                height: 10px;
                border: 1px solid white;
                background: red;
                margin-top: 20px;
            }
    </style> 
  </head>

  <body>
        <div id="id1"></div>        
  </body>
</html>

id1应该溢出,但不是.我将所有重要的div的“overflow”属性设置为“visible”(即使是默认值).我不知道我做错了什么

解决方法

总之,不可能有溢出的iframe. This post给出了解释.

为了实现类似的效果,您最好使用AJAX将嵌入式页面注入div,并使div溢出.

div内嵌iframe问题

div内嵌iframe问题

请教高手,我现在需要这样一种需求,div里面内嵌一个iframe,点击div中的确定按钮,去提交iframe里面的页面,或者是点击iframe中页面的提交按钮时,隐藏当前div?

关于IE 8中的CSS iframe问题ie css3的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于asp.net-mvc – MVC中的SSRS Reportviewer,通过自动调整iframe以适合报告来删除iframe滚动条、c# – 嵌入iframe时,ie9中的.NET Membership.GetUser()null和iframe中的safari、css – iframe的溢出问题、div内嵌iframe问题等相关知识的信息别忘了在本站进行查找喔。

本文标签: