Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8702233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:36:08+00:00 2026-06-13T02:36:08+00:00

I’m having a really hard time pinpointing the source of an intermittent problem in

  • 0

I’m having a really hard time pinpointing the source of an intermittent problem in an ASP.NET web application running on the Safari browser on a third-generation iPad running iOS 6.0. What happens is that, on occasion, the that <a> tags set up as hyperlinks that do postbacks via JavaScript will suddenly stop working and don’t appear to do anything if you touch them on the screen. These include an asp:LinkButton control that is set up as a logout link, and the header row of a GridView that is set up to allowing row sorting. There seems to be no rhyme or reason behind it – they will work as normal for awhile, then stop, and I’ll later notice that they start working again (mostly after closing Safari and re-opening it, though that doesn’t always seem to work).

The logout control looks like this in the aspx file:

<asp:LinkButton ID="LogoutButton" onclick="LogoutButton_Click" runat="server">[ Logout ]</asp:LinkButton>

and appears as this in the resulting HTML:

<a id="LogoutButton" href="javascript:__doPostBack(&#39;ctl00$LogoutButton&#39;,&#39;&#39;)">[ Logout ]</a>

Is there anything special about Safari running on the iPad that might prevent such links to break on occasion, such as too much data loaded on the page or in other open browser tabs, or maybe something with the ViewState that is acting up in this scenario? Even after playing around with the web application on the iPad for awhile, I can’t find any particular way to recreate the problem, so I can’t even begin to try to fix it which is really frustrating, so I’m looking for guidance from those who have developed ASP.NET apps and know the iPad and/or Safari environments really well. I’ve never had this problem occur on a desktop browser.

Update: Using the trick outlined on this page about how to add a pseudo-View Source option to Safari on the iPad, I have now been able to see the difference in the generated HTML of a page where the postback links are working, and a page where it’s stopped. In short, the __doPostBack JavaScript function that ASP.NET normally imbeds in the page… simply stops getting imbedded for some reason. As a result, the JavaScript tied to the links simply error out. Here’s what ASP.NET normally adds to the page to get the postback links working:

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>

This appears to be the same issue described on the Apple support forum and here on SO. The latter suggests that ASP.NET may sometimes be failing to recognize Safari on the iPad as being JavaScript capable and thus doesn’t properly insert the __doPostBack function into the page. Other JavaScript on my page is still working fine, though, so it doesn’t fully explain my problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:36:09+00:00Added an answer on June 13, 2026 at 2:36 am

    After finding this question on Stack Overflow with virtually the same problem, I ran the browserCaps output page suggested by Stephen and found that Safari, when run in full screen mode from a link on the iPad’s home screen, appeared to our ASP.NET server as a generic, no capability browser. I applied the fix suggested by Avada Kedavra in that other question, which entailed putting this:

    <browserCaps userAgentCacheKeyLength="256" />
    

    …into the <system.web> section of my web.config file, and also this:

    protected void Page_PreInit(object sender, EventArgs e)
    {
       if (Request.UserAgent != null && Request.UserAgent.IndexOf("AppleWebKit", StringComparison.CurrentCultureIgnoreCase) > -1)
       {
          this.ClientTarget = "uplevel";
       }
    }
    

    in the code behind file for the main web page that was acting up. Jason Kealey, the source of that other person’s fix, also suggests in the comments section of his findings that it might also be helpful to add this to a .browser file in the App_Browsers folder of your ASP.NET web application:

    <browsers>
      <browser refID="Mozilla" >
        <capabilities>
          <capability name="cookies"  value="true" />
          <capability name="type" value="Uplevel" />
        </capabilities>
      </browser>
    
      <browser refID="Default">
        <capabilities>
          <capability name="cookies" value="true" />
          <capability name="type" value="Uplevel" />
        </capabilities>
      </browser>
    </browsers>
    

    Edit:
    I applied this fix to my application, but it broke other areas, specifically, it was identifying Chrome and Safari as “uplevel”, which caused it to be detected in other areas as “IE”. The code below makes this fix only apply to iDevices when not identified in the user agent as Safari:

    string ua = Request.UserAgent;
    if (ua != null
        && (ua.IndexOf("iPhone", StringComparison.CurrentCultureIgnoreCase) >= 0
        || ua.IndexOf("iPad", StringComparison.CurrentCultureIgnoreCase) >= 0
        || ua.IndexOf("iPod", StringComparison.CurrentCultureIgnoreCase) >= 0)
        && ua.IndexOf("Safari", StringComparison.CurrentCultureIgnoreCase) < 0)
    {
        this.ClientTarget = "uplevel";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am currently running into a problem where an element is coming back from
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I've tracked down a weird MySQL problem to the two different ways I was
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm having trouble keeping the paragraph square between the quote marks. In firefox the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.