server-side ASP.NET onclick handler doesn't fire when submitted from browser on Apple device
<p>I have a form which has two panels, one which captures a username and password via textboxes and the other which does the serious stuff. Only one panel shows at any one time. The login panel shows until a user has logged in successfully, then the other panel shows.</p>

<p>On iPads and iPhones, using Safari or Chrome, the "Proceed" button of the login panel posts back, but the handler doesn't fire:</p>

<pre><code>&lt;asp:Button ID="cmdProceed" runat="server" Text="Proceed" OnClientClick="cmdProceedClientClick();" /&gt;

Protected Sub cmdProceed_Click(sender As Object, e As System.EventArgs) Handles cmdProceed.Click
  Dim cmdProcSP As SqlCommand = dbWeb.GetStoredProcCommand("uspAuthenticate")
  ...
End Sub
</code></pre>

<p>The "same" code (I understand that ASP.NET may generate different code for different browsers) works fine on the latest IE, Firefox and Chrome on a PC, and also in Chrome on my Moto-G.</p>

<p>Trawling through <a href="https://stackoverflow.com/questions/2155048/onclientclick-and-onclick-is-not-working-at-the-same-time">SO</a>, I find instances of where a postback isn't triggered at all, especially when there is also a client-side click handler defined, but that is not the problem, the postback works, but the ASP.NET click handler doesn't fire.</p>

<p>I found a nice trick to <a href="http://www.hongkiat.com/blog/view-source-codes-in-ipad-iphone/" rel="nofollow noreferrer">view the page source in Safari</a> but nothing looks to be amiss or missing.</p>

<p>Happily I have a workaround for this problem in this instance, just calling the handler myself in Page.Load</p>

<pre><code>If Request("txtUserName") &lt;&gt; "" And Request("txtPassword") &lt;&gt; "" Then cmdProceed_Click(Nothing, Nothing)
</code></pre>

<p>but I'd still like to know what's going wrong and an answer might help someone else. </p>