ajax 请求豆瓣ipa,ASP.NET Ajax postback suddenly stops on IPhone/IPa

I have an Asp.Net 4.0 website/control interface that uses an update panel and some buttons. The update panel is wired to a timer that executes every 5 seconds, causing a partial postback. The buttons toggles some settings and then forces an update of the update panel through a call similar to this:

var prm = Sys.WebForms.PageRequestManager.getInstance();

prm._doPostBack('', '');

return true;

The site runs fine on IE/Firefox and on Safari mobile devices (IPhone/IPad) but on the mobile devices the postback randomly and silently stops working. I figure this may have to do with saving batteries and that safari shuts the partial postback down when its idle. The problem is that when the user returns to the site the postback is completely shut off and neither the timer nor the buttons causes any postbacks no more. (I have monitored the network traffic on the server to verify this). Not even when the user refreshes the website (multiple times) the partial postback comes back into play. It just stops posting data to the server. Then suddenly and for no particular reason the postback starts working again. The downtime is often up to 10 minutes, which completely renders my website useless for its purpose.

Given that it takes so long before the postback starts again I wonder if there are any settings on either client side or in IIS to play with?

The website will run only on my customers devices, its not public, so if there is any settings to play with on the client I am up for it.

I am really confused about this and haven't found a way to trigger the "bug", it just happens sometimes. Any advices and tips are much appreciated.

Update:

Added some error handling and I have (not consistently) receive the following message when the postback fails:

The page is performing an async postback but the ScriptManager.SupportParialRendering property is set to false. Ensure that the property is set to true during postback.

Odly enough this property is obviously true for the device in the first instance, otherwise the postback would never work, which is not the case.

Update 2:

Found the folloing blog post suggesting to change the browserCap setting in web.config. Trying this now. Will report back. Other suggestions are still much welcomed.

ASP.NET 4 BrowserCaps (or: what were they thinking?)

The above disables javascript in safari mobile in fullscreen mode (running from home screen). The following article suggests a fix on this issue.

Gotcha: iPad versus ASP.NET

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值