原因ASP.NET AJAX将被禁用 [英] Reasons why ASP.NET AJAX would be disabled

查看:136
本文介绍了原因ASP.NET AJAX将被禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用ASP.NET AJAX和AJAX控件工具包的ASP.NET应用程序。该应用程序运行在PC上的所有最新的浏览器的罚款。它也能正常工作在我的iPad,至少第一次访问应用程序。我发现,如果我关闭iPad和返回页面后(通过书签或类似),该网站被打破了。我缩小了故障,一个ASP.NET/ASP.NET AJAX问题/错误/限制,我在寻找一些帮助的进展。

I have an ASP.NET application that uses ASP.NET AJAX and the AJAX Control Toolkit. The application runs fine on all recent browsers on a PC. It also works fine on my iPad, at least the first time the application is accessed. I have found that if I shut down the iPad and return to the page later (via a bookmark or similar), the site is broken. I have narrowed down the failure to an ASP.NET/ASP.NET AJAX issue/bug/limitation, and I'm looking for some help to progress.

使用招作为iPad的代理服务器,我已经确定了以下问题,重新打开页面时。

Using Fiddler as a proxy server for the iPad, I have identified the following problems, when re-opening the page.


  1. 我*。皮肤文件没有正确应用。生成的风格标签根本不包括一些在*。皮肤文件中指定的参数。

  2. 的页面不包括MicrosoftAjaxWebForms.js文件。 (工作时,它会发出右上面的所有ToolkitScriptManager脚本来的ScriptResource.axd参考。

  3. 的页面不包括其他的js文件的引用开始功能WebForm_FindFirstFocusableChild(对​​照组)

  4. 的页面不包括一些隐藏的字段,如__LASTFOCUS,__EVENTTARGET和__EVENTARGUMENT

  5. 页面不包括脚本块使用document.forms ['aspnetForm']和定义__doPostBack。

  6. 页面不包括脚本块执行Sys.WebForms.PageRequestManager._initialize

  7. 其他一些初始化脚本不是present(设置聚焦,创造的UpdateProgress等)

不知何故,它出现在框架决定它不不需要这些脚本和不发射它们。鉴于所有的脚本是相互关联的,必须有一个共同的原因。这可能与该。皮肤性质*不包含的原因。有任何想法吗?我曾想过浏览器功能,但这只是发生在该网站,而不是第一个后续访问。

Somehow, it appears the framework decides that it isn't doesn't need these scripts and doesn't emit them. Given all the scripts are interrelated, there must be a common reason. This may be related to the reason that the *.skin properties are not included. Any ideas? I would have thought about browser capabilities, but this only happens on subsequent visits to the site, not the first.

编辑:
绝对看上去就像一个浏览器功能的问题。

Definitely looking like a browser capability issue.

请求工作:
用户代理:Mozilla的/ 5.0(新iPad; U; CPU OS 4_3_3喜欢Mac OS X; EN-US)为AppleWebKit / 533.17.9(KHTML,例如Gecko)版本/ 5.0.2

这不要求:
用户代理:Mozilla的/ 5.0(新iPad; U; CPU OS 4_3_3喜欢Mac OS X; EN-US)为AppleWebKit / 533.17.9(KHTML,例如Gecko)移动/ 8J2

将尝试创造App_Browsers文件自定义文件,并张贴回来了额外的信息。

Will attempt creating a custom file in App_Browsers and post back with extra info.

推荐答案

根问题确实ASP.NET识别iPad作为一个通用的下层Mozilla的,而不是Safari浏览器,的当应用程序以全屏幕加载模式的。它认为是不支持JavaScript等

The root issue is indeed ASP.NET recognizes the iPad as a generic downlevel 'Mozilla' instead of Safari, when the application is loaded in full screen mode. It thinks JavaScript is not supported, etc.

该解决方案中加入以下所有的ASP.NET页面(加入这基本页所有的ASP.NET页面派生自)。

The solution is adding the following to all of your ASP.NET pages (by adding this to the base page all your ASP.NET pages derive from).

    protected void Page_PreInit(object sender, EventArgs e)
    {
        if (Request.UserAgent != null && Request.UserAgent.IndexOf("AppleWebKit", StringComparison.CurrentCultureIgnoreCase) > -1)
        {
            this.ClientTarget = "uplevel";
        }
    }

(我尝试创建一个* .browser文件,但悲惨地失败了,因为它不会出现,我可以从内部我自己的参考框架的* .browser文件。)

(I tried creating a single *.browser file but failed miserably as it doesn't appear I can reference the framework's *.browser files from within my own.)

这篇关于原因ASP.NET AJAX将被禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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