473,569 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enter Key Postback

I have a web form that is a child of a Master Page. It is a login form for
forms authentication.

When you fill in the username and password box and press ENTER it doesnt
process any of the VB.NET code it sits there doing nothing.

I've tried some of the solutions on the internet but they don't work - I
think it might have something to do with the fact I'm using a Master Page...?

PLEASE HELP! This is driving me nuts!!

Andrew.
Nov 19 '05 #1
6 2496
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.)

Nov 19 '05 #2
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/....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]"" wrote:
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.)

Nov 19 '05 #3
Thanks Andrew,

I'll follow the link you provided and have a look.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #4
Hi Andrew,

Seems I can't get the detailed code snippet from the
http://www.experts-exchange.com/

Do I need to sign on that site? Anyway, I'd appreciate if you can paste the
code snippet here.

Thank you,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #5
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

"Andrew Willett" <Andrew Wi*****@discuss ions.microsoft. com> wrote in message
news:11******** *************** ***********@mic rosoft.com...
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/....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]"" wrote:
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.)

Nov 19 '05 #6
Don't forget to add "Handles MyBase.PreRende r" to "Sub Page_PreRender( sender
As Object, e As EventArgs)"
"Chris Gill" <ch********@cle ver4.net> wrote in message
news:uH******** ************@ka roo.co.uk...
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

"Andrew Willett" <Andrew Wi*****@discuss ions.microsoft. com> wrote in message news:11******** *************** ***********@mic rosoft.com...
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/....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]"" wrote:
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.)


Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1496
by: Robert Dickow | last post by:
I have some ASP.NET Web App pages on which there are web forms with textboxes and buttons for 'Cancel' and 'Submit' and such. All works great. However, it a user uses the ENTER key in either of two textboxes, the postback 'falls through' to one of the 'Cancel' button handlers, and exits the application. Oddly, I can't use anything in the...
2
1299
by: Phillip Kennedy | last post by:
Hi, HELP!!!! we are having a problem where we have a web page with a number of buttons and form fields, unfortunately whenevr we hit the enter key in a form field it is envokingthe 1st button, WHY??? this is a major issue for us please help......
2
7167
by: Cindy | last post by:
Hi all you smarties out there, I'm having a little conundrum with my asp.net page Scenario: I have a form (asp.net) with no code behind (as yet). I have placed a javascript function on a server side textbox control to do something - eg change the words on label - when the key pressed is the "enter" key. I can see the label change to...
0
1499
by: Tony Hedge | last post by:
Hello, I can briefly explain without providing any code, it's a simple NET 1.1 web project. I have a web form with a textbox A and button A (in a table row), and textbox B and button B (in a second table row). The textboxes are of type asp:Textbox and buttons are asp:Button. Autopostback=false for textboxes. Click event used for the...
6
3730
by: guoqi zheng | last post by:
In a regular html form, when user press "enter" key, the form will be submitted. However, in ASP.NET web form, a form will only be submitted (post back) when a special button is clicked. Many user get used to click "enter" key to submit a form. How can I use "enter" key to submit/postback in ASP.NET. Thank, Guoqi Zheng
4
2876
by: peshrad | last post by:
Hi ! I'm working with Win 2K and Visual Studio 2003. I have a problem because pressing <ENTER> in a text input control causes a postback of my web form. Here comes some example code (already stripped of most of the unnecessary code): ----------------------------------------------------------------------------
11
7727
by: Joe | last post by:
Hello All, I have an ASP.NET page with one Textbox (SearchTextBox) and one ImageButton (SearchButton) server controls. The user can type search text in SearchTextBox and click SearchButton and the web server performs a database query and displays the results. All of this works fine. I want the user to be able to press the Enter key...
0
2442
by: joe | last post by:
How to disable imagebutton postback when i enter "enter" i just want postback when click mouse
5
2738
by: =?Utf-8?B?SnVsaWEgQg==?= | last post by:
Hi all I've got a very complex form with loads of text boxes and buttons on it. It's causing me all sorts of problems when users press the enter key and cause a postback. I need to disable the enter key. I've done some surfing and found some Microsoft recommended code but it doesn't seem to work and I'm wondering what I've done wrong. If...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8132
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5222
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3656
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1226
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.