Ankit Rana Ankit Rana - 1 year ago 110
ASP.NET (C#) Question

Why use ClientTarget = "uplevel" in

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

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.

Reference link :

Answer Source

From 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.

  • uplevel, which specifies browser capabilities equivalent to Internet Explorer 6.0.

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download