Safari和ASP.NET AJAX PageRequestManager.add_endRequest功能不总是射击 [英] Safari and ASP.NET AJAX PageRequestManager.add_endRequest Function Not Always Firing

查看:248
本文介绍了Safari和ASP.NET AJAX PageRequestManager.add_endRequest功能不总是射击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里的背景资料第一。 ASP.NET 2.0 Web站点使用AJAX扩展1.0。

Here's the background info first. ASP.NET 2.0 Web Site with AJAX Extensions 1.0.

我有只发生在Safari一个奇怪的问题,我只能假设铬也因为它们都使用WebKit的。我还使用jQuery的网站,但目前引用的jQuery只装在一个页面上,所以我不认为这是问题。

I have a weird issue that only occurs in Safari and I can only assume Chrome as well since they both use WebKit. I also use jQuery in the site, but currently the reference to jQuery is only loaded on one page so I don't think this is the issue.

我有一个友好的处理请求...当你提交一个页面异步或非异步回发时出现),并回传后,隐藏的消息。在异步回发的情况下,我使用的 PageRequestManager add_endRequest(...)方法来隐藏处理请求...消息。这在FireFox,IE 6/7/8和Opera但在Safari某种原因(Windows和Mac版本)的伟大工程,在 add_endRequest(...)总是不火。我所有关于跨浏览器,只是想知道如果任何人有如何解决这一问题的任何想法。

I have a friendly "Processing Request..." message that appears when you submit a page async or non-async postback) and hides after postback. In the case of the async postback, I use the PageRequestManager's add_endRequest(...) method to hide the "Processing Request..." message. This works great in FireFox, IE 6/7/8 and Opera but for some reason on Safari (Windows and Mac versions), the add_endRequest(...) does not always fire. I'm all about the cross browser so just wondering if anyone has any ideas on how to fix this.

这是我的显示塞,因为不仅在处理请求...消息出现,但我也把一个透明的div上整个页面prevent多次点击顶部提交后,所以除非你知道如何破解CSS来隐藏DIV透明页面变得不可用。

This is a show stopper for me because not only does the "Processing Request..." message appear, but I also put a transparent div on top of the entire page to prevent multiple clicks after submitting, so the page becomes unusable unless you know how to hack the CSS to hide the transparent div.

下面是从我做什么来处理我的我的主人页面的标记中的code片段处理请求...消息:

Here's the code snippet from my master page's markup of what I do to handle my "Processing Request..." message:

<asp:ScriptManager ID="ScriptManager1" runat="server" />
<script type="text/javascript" src="<%= ResolveClientUrl("~/Script/aspNetAjaxFix.js") %>"></script>
<script type="text/javascript" >
(function() {
    var processingID = "<%=processing.ClientID%>"
    var prm = Sys.WebForms.PageRequestManager.getInstance();

    if (prm)
    {
        prm.add_endRequest(
        function (sender, args) {
            //alert('Fired!')
            if (top['showAsyncProcessingWindow'])
            {
                setTimeout(function(){document.getElementById(processingID).className="LockOff";document.getElementById('processMe').className='processMeLockOff';if(typeof(showIE6Selects)!="undefined"){showIE6Selects();}}, 1000);
                top['showAsyncProcessingWindow'] = false;
            }

            if(args.get_error() && args.get_error().name === 'Sys.WebForms.PageRequestManagerServerErrorException')
            {
                args.set_errorHandled(args._error.httpStatusCode == 0);
            }
        });
    }
})();
</script>

如果你想知道aspNetAjaxFix.js是什么,看到这个问题,我贴在计算器上,<一个href=\"http://stackoverflow.com/questions/757758/internet-explorers-operation-aborted-and-latency-issue\">http://stackoverflow.com/questions/757758/internet-explorers-operation-aborted-and-latency-issue

我也没有太大的运气Google搜索,当然这一点。这篇文章似乎是相关的, http://forums.asp.net/t/1247957.aspx ,但只问同样的问题,没有解决方案。

I also Googled this of course with not much luck. This article seemed to be relevant ,http://forums.asp.net/t/1247957.aspx but only asks the same question, no solution.

任何洞察到这一问题将会大大AP preciated。

Any insight into this issue would be greatly appreciated.

推荐答案

在好一些更多的挖掘,我发现了问题。它无关的的 PageRequestManager add_endRequest(...)方法和一切与浏览器检测在ASP.NET AJAX客户端API的Safari浏览器和WebKit基于浏览器。

Well after some more digging, I found out the issue. It has nothing to do with the PageRequestManager's add_endRequest(...) method and everything to do with Browser detection in the ASP.NET AJAX client-side API for Safari and WebKit based browsers.

由于这个职位从 taliesins 在ASP.NET论坛的 http://forums.asp.net/t/1252014.aspx 。我发现这个职位,首先看到我在得到这个错误:

Thanks to this post from taliesins on the ASP.NET forums, http://forums.asp.net/t/1252014.aspx. I found this post by first seeing that I was getting this error:

Sys.ScriptLoadFailedException: The script 'http://localhost:2241/WebResource.axd?d=hvpXhV5kEMwLgAoaIglURevR_XTtDTBoKZ3aZWWaIvEkBXbLudri1AIv5bRs5f6licjCZMs3Z3MioQLqLTXV98582pKDHkD7BucGkKsPLz41&t=633444640020014740' failed to load. Check for:
Inaccessible path.
Script errors. (IE) Enable 'Display a notification about every script error' under advanced settings.
Missing call to Sys.Application.notifyScriptLoaded().

尽管我打电话 Sys.Application.notifyScriptLoaded()在我的JavaScript。

even though I was calling Sys.Application.notifyScriptLoaded() in my JavaScript.

显示塞解决。

这篇关于Safari和ASP.NET AJAX PageRequestManager.add_endRequest功能不总是射击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆