Function __doPostBack() does not work in iOS, iPadOS browsers

270 views Asked by At

I'm developing an ASP.NET Webform website using .NET Framework 4.6, C# and Javascript,

I've used HiddenField to store a value from a navigation drawer, then do a postback to update value in UpdatePanel, but seem that the code stucked at __doPostBack() on iOS, iPadOS browsers (all Safari, Chrome, Firefox), for Windows browsers everything works fine. Below is my Javascript code:

function headChange(e) {
   __doPostBack('<%=HiddenField1.ClientID%>', '');
};

I tried several methods found on Internet such as:

  • Added <browserCaps userAgentCacheKeyLength="256"/> in web.config
  • Added return false; after __doPostBack('<%=HiddenField1.ClientID%>', '');
  • Replace __doPostBack('<%=HiddenField1.ClientID%>', ''); by <%= Page.ClientScript.GetPostBackEventReference(HiddenField1, String.Empty) %>;
  • Added a browser file to App_Browsers folder

but all with no luck,

Has anyone encountered the same problem and found the solution for this? Thank you very much!

1

There are 1 answers

0
Trinh Thang Long On

I found the error by do Inspect Element in Sarari, the error is shown as follow:

https://ibb.co/ynL1Zhp

"Function.caller used to retrieve strict caller" cause by __doPostBack function in MicrosoftAjaxWebforms.js

Then I found the solution for this by https://stackoverflow.com/a/25686598/7819116

Now my website works well in iOS browsers

Thank you all for the supports!