为什么在asp.net中使用ClientTarget = " uplevel " ?

时间:2021-02-06 20:05:57

I am working on asp.net web form application, in register page, autopostback does not work properly in safari browser, I found solution but i want to understand

我正在做asp.net web表单应用程序,在注册页面中,autopostback在safari浏览器中不能正常工作,我找到了解决方案,但我想了解。

string ua = Request.UserAgent;
if (ua != null
    && (ua.IndexOf("iPhone", StringComparison.OrdinalIgnoreCase) >= 0
    || ua.IndexOf("iPad", StringComparison.OrdinalIgnoreCase) >= 0
    || ua.IndexOf("iPod", StringComparison.OrdinalIgnoreCase) >= 0)
    && ua.IndexOf("Safari", StringComparison.OrdinalIgnoreCase) > 0)
{
    this.ClientTarget = "uplevel"; // what does this mean?
}

Please explain me what is meaning of uplevel.

请解释一下uplevel的含义。

Reference link :http://blog.lavablast.com/post/2011/05/29/Gotcha-iPad-versus-ASPNET.aspx

参考链接:http://blog.lavablast.com/post/2011/05/29/Gotcha-iPad-versus-ASPNET.aspx

1 个解决方案

#1


0  

From MSDN:

从MSDN:

ClientTarget property gets or sets a value that allows you to override automatic detection of browser capabilities and to specify how a page is rendered for particular browser clients.

ClientTarget属性获取或设置一个值,该值允许您重写浏览器功能的自动检测,并指定如何为特定的浏览器客户端呈现页面。

  • uplevel, which specifies browser capabilities equivalent to Internet Explorer 6.0.
  • uplevel,它指定了相当于Internet Explorer 6.0的浏览器功能。

So in your case: With this.ClientTarget = "uplevel" you are making sure your application runs properly in your Safari browser.

所以在你的例子中:用这个。您正在确保您的应用程序在Safari浏览器中正常运行。

#1


0  

From MSDN:

从MSDN:

ClientTarget property gets or sets a value that allows you to override automatic detection of browser capabilities and to specify how a page is rendered for particular browser clients.

ClientTarget属性获取或设置一个值,该值允许您重写浏览器功能的自动检测,并指定如何为特定的浏览器客户端呈现页面。

  • uplevel, which specifies browser capabilities equivalent to Internet Explorer 6.0.
  • uplevel,它指定了相当于Internet Explorer 6.0的浏览器功能。

So in your case: With this.ClientTarget = "uplevel" you are making sure your application runs properly in your Safari browser.

所以在你的例子中:用这个。您正在确保您的应用程序在Safari浏览器中正常运行。