UIWebview and IPhone Content Not Delayed (ASP.NET Browser Capabilities Issues)

I have a simple page, the structure of which is as follows (pseudocode):

<aspx page> <ascx control> <asp:dropdownlist id="dd1" autoPostback=true /> <asp:dropdownlist id="dd2" /> </ascx control> </aspx page> 

In ANY desktop browser, dd1 is sent back, and the "SelectedIndexChanged" server event is fired. However, IPhone safari or IPhone web browsing does not postback. I know this because the network activity indicator is not displayed, and I connected the debugger to the site, which catches all serveride events, and it never hits. Sometimes, about once every 2 hours, postback DOES works on the iphone, but is extremely rare and intermittent.

Dd1 is a drop-down list that loads a drop-down time interval that depends on the selected item in the date drop-down list. This form is reused in many places, and I do not want to change the basic structure, if it is not the last effort.

Javascript is included in safari settings.

Simple enough? I'm trying to figure out how to debug JavaScript errors in a webview, but I was wondering if anyone knew what weirdness this behavior created.

+5
source share
1 answer

The IPhones UIWebView user agent was not recognized by ASP.NET 4.0, so asp.net was the default version of Downlevel on a page that did not contain javascript. Iphones webview user agent:

Mozilla / 5.0 (iPhone, U, CPU iPhone OS 4_3_5, like Mac OS X, en-us) AppleWebKit / 533.17.9 (KHTML, like Gecko) Mobile / 8L1

To avoid this, I changed the "ClientTarget" property on the "UpLevel" page, which bypasses asp.net, trying to understand the capabilities of the browser and just serves javascript and that's it. "

Solution on my Page_Load page:

Me.ClientTarget = "uplevel"

or

this.ClientTarget = "uplevel";

+7
source

Source: https://habr.com/ru/post/900049/


All Articles