1

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.

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

<asp:Button ID="cmdProceed" runat="server" Text="Proceed" OnClientClick="cmdProceedClientClick();" />

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

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.

Trawling through SO, 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.

I found a nice trick to view the page source in Safari but nothing looks to be amiss or missing.

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

If Request("txtUserName") <> "" And Request("txtPassword") <> "" Then cmdProceed_Click(Nothing, Nothing)

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

Community
  • 1
  • 1
DJDave
  • 865
  • 1
  • 13
  • 28

0 Answers0