OK, I accept

This site uses cookies. By using this site, you acknowledge and accept this.

Your basket is empty
Login not logged in

Full Knowledgebase Listing

Issues with postbacks on Kartris interface on iPads and some other devices

[#49] Last update 1 Jun 2013

You may find that certain features on Kartris don't work correctly on iPads and other devices, for example language switching. This is due to ASP.NET's browser capabilities detection which wrongly identifies some browsers as incapable of handling 'up level' features, and so serve them simpler HTML.

There are two steps that in our experience combine to fix this.

This first is to add the following to the system.web section of your web.config file:

<browserCaps userAgentCacheKeyLength="256" />

This ensures that the full user agent of the browswer can be picked up, rather than just the first 64 characters (which is the default).

The second part is to add the following code to the PageBaseClass.vb, which all pages inherit (the code could actually go in the Page_Load even of individual pages, but since all our pages inherit from the PageBaseClass or _PageBaseClass files, it is simpler to add the code there):

Dim strUserAgent As String = Request.UserAgent
  If strUserAgent IsNot Nothing _
    AndAlso (strUserAgent.IndexOf("iPhone", StringComparison.CurrentCultureIgnoreCase) >= 0 _
    OrElse strUserAgent.IndexOf("iPad", StringComparison.CurrentCultureIgnoreCase) >= 0 _
    OrElse strUserAgent.IndexOf("iPod", StringComparison.CurrentCultureIgnoreCase) >= 0) _
    AndAlso strUserAgent.IndexOf("Safari", StringComparison.CurrentCultureIgnoreCase) < 0 Then
    Me.ClientTarget = "uplevel"
  End If
Powered by kartris