473,465 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ASP.NET 2 Enter Key and master page

Hi there,

I'm using framework 2 and web site application with master page and more
than 30 pages used master. I have users come from desktop application who
like to hit Enter every time they entered some things in the textbox. I would
like to disable the Enter Key for this application. Any ideas how to disable
enter key for the whole application.

Thanks.
Oct 23 '07 #1
3 6149
Add following attribute to the BODY tag of the masterpage:

onkeydown="javascript:if(event.keyCode==13){event. keyCode=9;}"

You should get something like this:

<body onkeydown="javascript:if(event.keyCode==13){event. keyCode=9;}">
....
</body>

It will change ENTER key behavoiur - it will work as TAB key.
--
Nail
[MCPD: WEB]
Oct 24 '07 #2
Hi Nail,

Thank you very much. It's working beautiful.

Madison

"Nail" wrote:
Add following attribute to the BODY tag of the masterpage:

onkeydown="javascript:if(event.keyCode==13){event. keyCode=9;}"

You should get something like this:

<body onkeydown="javascript:if(event.keyCode==13){event. keyCode=9;}">
....
</body>

It will change ENTER key behavoiur - it will work as TAB key.
--
Nail
[MCPD: WEB]
Oct 24 '07 #3
Thank you very much. It's working beautiful.

But that's a horrible solution.

Enter = form submit is a basic function of a web browser. This isn't an
application issue, it's a user training issue.

Disabling the enter key may placate the uneducated users, but it's going to
infuriate any power user and also makes your site that more inaccessible.

-Darrel
Oct 24 '07 #4

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

Similar topics

1
by: Stephen J. Shephard | last post by:
Hi there, I know this is probably a 101-type question, and I've dealt with it using client script blocks before, but I'm curious about what the best way to handle the enter key is.. (i.e., to...
6
by: Andrew Willett | last post by:
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...
5
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the...
1
by: HS1 | last post by:
Hello all - I have a master and a details table presented in two datagrid - I also have some text boxes that present the values from any record in the master table. This also helps to enter new...
4
by: sowencheung | last post by:
Hi, all The scenario is like this: I have a master page, contains two user controls, one is a search control, another is a login control. The server-side <form> is in the master page,...
17
by: Rob R. Ainscough | last post by:
Again another simple concept that appears NOT to be intuitive or I'm just stupid. I've read the WROX book and the example doesn't actually show how the .master page links in the other content...
1
by: Webmills | last post by:
Hi I have a log out button at the top of my site. It is contained within a web control within the master page. Because it is the first button on the page, then by default it is the one that...
2
by: pratsadhu | last post by:
Hi, I have a web application which has a set of content pages under the master page. In one of the content pages i have a set of textboxes. When i focus on of the textboxes and press enter,...
1
by: =?Utf-8?B?TWFkaXNvbg==?= | last post by:
Hi All, I have web application in Framework 2 with master page which have this code in body tag <body onkeydown="javascript:if(event.keyCode==13){event.keyCode=9;}"this codes work very nicely all...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.