Reasons why ASP.NET AJAX would be disabled

寵の児 提交于 2019-12-03 14:05:51

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.

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";
        }
    }

(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.)

I usually do this in global.asax

void Application_BeginRequest(Object sender, EventArgs e)
{
    Request.Browser.Adapters.Clear();
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!