Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

In ASP.NET (not v2.0) Fire a Default Button when ENTER key is pressed

Posted on 2006-06-29
5
Medium Priority
?
299 Views
Last Modified: 2011-10-03


I have several pages within a web application I have developed.  A problem I have is with the default key that fires when the user presses the ENTER key instead of either the SAVE or SUBMIT or OK key.  I have read through some of the previous questions on this issue and this one (below) suggests to make all other buttons on the page except the one you want to be the default for the ENTER key to be INPUT TYPE="button" and to make the one that needs to be the default button to be INPUT TYPE="submit".

http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_21712452.html 
 
The buttons I have on my pages are ALL <asp:buttons> and when the page is rendered I see (in View/Source) that all the buttons are rendered as INPUT TYPE="submit"..

My question is how do I force an <asp:button> to render as INPUT TYPE="button"

All I am trying to do is to allow the user to have the choice of using the ENTER button or the SUBMIT button to submit the page to the server.

Any help will be great...thanks.msyed1.
0
Comment
Question by:msyed1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 9

Expert Comment

by:zaghaghi
ID: 17011113
I use a submit button with width="0"

but in firefox the button can be seen,

see
http://edari.koaj.ir

I use a submit button for login
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 800 total points
ID: 17011230
You have to change them from asp:button to <input> yourself, AFAIK.

Bob
0
 

Author Comment

by:msyed1
ID: 17012501
TheLearnedOne, you mean at run time (programatically) or at design time itself ??
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17012738
At design time itself.

Bob
0
 
LVL 25

Assisted Solution

by:DBAduck - Ben Miller
DBAduck - Ben Miller earned 200 total points
ID: 17012754
You should check out this control.

http://www.metabuilders.com/Tools/DefaultButtons.aspx

Ben.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question