【问题标题】:Ajax ModalPopup wrong display in IE8Ajax ModalPopup 在 IE8 中显示错误
【发布时间】:2013-04-10 15:10:13
【问题描述】:

我在 IE8 上使用 modalPopup 控件时遇到问题。 需要弹出的面板已经弹出。

看起来像(在比 IE 8 更新的浏览器中),一行中有面板,当您单击其中一个时,会弹出一个窗口(使用 AJAX modalPopUp)

在 IE8 中,它显示弹出窗口(面板),甚至无需单击列表中的面板之一。

代码如下:

<asp:updatepanel id="UpdatePanel1" runat="server">
<contenttemplate>
<asp:panel id="PanelManufacturerPictures" runat="server" scrollbars="Auto" width="100%">
<asp:datalist id="DataListManufacturersPictures" runat="server" cellpadding="5" repeatdirection="Horizontal" repeatcolumns="11" showfooter="False" showheader="False" cellspacing="16">
<itemstyle height="75px" width="75px"/>
<itemtemplate>
    <asp:imagebutton id="ImageButtonManufacturerPicture" runat="server" alternatetext='<%# eval("manufacturername") %>' Height="100%" ImageUrl='<%# "~/elimansourwcf/manufacturerspictures/"+databinder.eval(container.dataitem, "imageurl") %>' ToolTip='<%# eval("manufacturername") %>' Width="100%" CausesValidation="False" /> <asp:roundedcornersextender id="RoundedCornersExtenderDetailsManufacturers" runat="server" targetcontrolid="PanelManufacturersDetails" radius="8" bordercolor="Red">
</asp:roundedcornersextender>
<asp:modalpopupextender id="ModalPopupExtenderManufacturerDetails" runat="server" popupcontrolid="PanelManufacturersDetails" targetcontrolid="ImageButtonManufacturerPicture" backgroundcssclass="modalBackgroundProducts" cancelcontrolid="ButtonManuCancel">
</asp:modalpopupextender>
<asp:panel id="PanelManufacturersDetails" runat="server" backcolor="White">
<div dir="rtl">
    <asp:label id="LabelManufacturerName" runat="server" font-bold="True" font-size="XX-Large"></asp:label>
    <div style="float: right;">
        <asp:table id="TableDetails" runat="server" cellpadding="15" font-bold="True" cellspacing="15">
        <asp:tablerow id="TableRow5" runat="server">
        <asp:tablecell id="TableCell8" runat="server" width="100px" horizontalalign="Left" columnspan="2">
        <asp:roundedcornersextender id="RoundedCornersExtenderDetailsManufacturerCancel" runat="server" targetcontrolid="ButtonManuCancel" radius="8">
        </asp:roundedcornersextender>
        <asp:button id="ButtonManuCancel" runat="server" text="צא מחלון זה" width="75px" causesvalidation="False" backcolor="Red" forecolor="White" font-bold="True"/>
        </asp:tablecell>
        </asp:tablerow>
        </asp:table>
    </div>
</div>
</asp:panel>
</itemtemplate>
</asp:datalist>
</asp:panel>
</contenttemplate>
</asp:updatepanel>

我看到一个帖子:

Ajax ModalPopup wrong display in IE8 - IE9 但我不明白把css“位置:绝对;”放在哪里

这是网站的网址:

www.emansour.co.il

感谢您的帮助

[编辑] 我注意到这个问题发生在我在有界数据控件中使用 modalPopup 时。

【问题讨论】:

  • 我认为它们不是同一个问题。我看不到 position:absolute 如何导致面板在页面加载时可见。可以分享一下网址吗?或创建一个 jsFiddle 或实时示例?
  • 这是网站的网址:www.emansour.co.il。尝试用IE8打开
  • 这是我收到Unexpected call to method or property access 的错误,是 ScriptResource.axd 导致的。使用 IE8 在本地开发中遇到同样的问题吗?服务器中安装的 AjaxToolkit 版本是否与本地服务器相同?
  • 是的,但我不知道这是什么。我认为这个问题不会在其他浏览器中显示
  • 我注意到这个问题发生在我在有界数据控件中使用 modalPopup 时。

标签: asp.net ajax internet-explorer-8 datalist modalpopupextender


【解决方案1】:

您的错误是由RoundedCornersExtender 之一引起的。出于某种原因,有时这些不能很好地嵌套在众多 Panels 控件和 UpdatePanels 中。我通过删除设置按钮样式的RoundedCornersExtender 解决了这个问题。删除此RoundedCornersExtender 控件,并在代码中添加以下css 类以使您的按钮具有圆角:

.rounded
{
    color: white;
    background-color: red;
    font-weight: bold;
    width: 75px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-bottom-left-radius: 8px;
    border: 0px none;
}

然后将样式应用到您的按钮:

<asp:Button ID="ButtonManuCancel" runat="server" Text="צא מחלון זה" Width="75px" CausesValidation="False" BackColor="Red" ForeColor="White" Font-Bold="True" CssClass="rounded" />

我离开了另一个 RoundedCornersExtender 并在 IE 上进行了测试,但没有收到错误消息。 AjaxToolkit 有时会非常有用,但有时可能会让人头疼。如果你想添加像这样的简单功能(简单的 css),我建议不要使用 ControlExtension 来完成这样一个简单的事情。对于更复杂的东西,我会使用 Ajax.net 控件,或者完全避免使用它。

【讨论】:

  • 谢谢老兄!你真的帮了我,我以为我永远不会摆脱这个问题!所以我的项目中的所有 RoundedCornersExtender 都存在问题(当然是 IE8)。所以我把它们都删除了,但不幸的是,你给我的圆形 css 不起作用,控件没有变成圆形。可能是因为 IE8 不支持 css 3?
  • 没问题。我安装了 IE8,我看到圆角...可能是别的东西?
  • 如果您真的需要 IE8 中的边框,请查看此内容-coding.smashingmagazine.com/2010/04/28/…
  • 哦,它可以工作,哈哈,有线的。非常感谢 !!我能再问你一个问题吗?您是如何分析错误并得出问题出在圆角 ajax 扩展上的?你们有专门的程序来跟踪这类错误吗?
  • 为这个点赞!
猜你喜欢
  • 1970-01-01
  • 2010-11-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多