Hi,
I have the exact same issue when using one textbox in a form with a submit
button, mouse clicking the button causes proper postback and event handling,
but enter key looks like it does the postback but doesn't trigger events.
This also only seems to be an IE bug???
The only workaround/fudge I have that consistently works is NOT to use the
buttons OnClick event, but to call the handling method from the top of the
PreRender of the page, only when the page is in postback, i.e. (vb example)
Sub Page_PreRender(sender As Object, e As EventArgs)
If Page.IsPostBack() Then
' Call the login event handler this way rather than on an OnClick
' button event to get around IE bug with only one textbox in form
ProcessSubmit()
End If
...
End Sub
Sub ProcessSubmit()
'event handling code exactly as in btnButton_Click() handler
...
End Sub
Now this is really only viable if there is one form and one submit button on
the page, otherwise you'll end up with all sorts of extra problems :O)
Looking forward to any other comments on this issue.
Cheers
Chris
Thanks for your message. I've created an 'Experts-Exchange' post for this
and
I've pasted all the HTML and ASP.NET code into it ... if you take a look
at
the following link I hope it will give you what you're after:
http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_21466176.html#14271172
I've tried putting a invisible HTML textbox in the login page's code as
per
a fix on a website, but i still get the same problem. If I CLICK the
Submit
button it all works fine, it's just when I press the enter key when the
focus
is in the password box does it NOT work.
The textboxes and submit button are all ASP controls running server-side
(as
opposed to HTML controls)
Thanks in advance!!
Andrew.
"WenJun Zhang[msft]" said:
Hi Andrew,
Welcome to ASPNET newsgroup.
From your description, one of your login page(ASP.NET2.0) which created
from a MasterPage didn't handle the login button's submit event correctly
,ye s?
Based on my understanding, when we enter "enter" key on a web page (at
lease in IE), the first submit button on the page will be clicked so as
to
submit the page. So If you found the page's login code not execute
correctly, it must be the page didn't be submit correctly. Is it working
correctly if we manually click that submit button?
also, as you mentioned that you've tried applying some tips on the
internet, would please paste some of those code snippets so that we can
have a further investigate here?
Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)