473,388 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

default button and enter

Hi,

Can somebody tell me how to convince explorer that my "button" will be
pressed when I press Enter - in other words that it will be default button.
Just like in windows forms. I use web form button.

Thanks,
Anton
Nov 18 '05 #1
4 1368
Jos
Anton ml. Vaheie wrote:
Hi,

Can somebody tell me how to convince explorer that my "button" will be
pressed when I press Enter - in other words that it will be default
button. Just like in windows forms. I use web form button.

Thanks,
Anton


Make it an HTML submit control, instead of an HTML button or a Web Control
button.
Don't forget to replace OnClick by OnServerClick.

--

Jos Branders
Nov 18 '05 #2
Hi Anton,
Here is the code snippet you need to add in your page load
event (serside)

Page.RegisterHiddenField("__EVENTTARGET","btnSave" );

In the above line, btnSave is my default button to save my data on the
form. This "RegisterHiddenField" to allows server controls to
automatically register a hidden field on the form. The field will be
sent to the Page when the HtmlForm server control is rendered.

I hope this will help you.

-Sri.

"Anton ml. Vaheie" <va*****@email.si> wrote in message news:<eU*************@tk2msftngp13.phx.gbl>...
Hi,

Can somebody tell me how to convince explorer that my "button" will be
pressed when I press Enter - in other words that it will be default button.
Just like in windows forms. I use web form button.

Thanks,
Anton

Nov 18 '05 #3
Check out this article for how to do this,
http://www.allasp.net/enterkey.aspx

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"Anton ml. Vaheie" <va*****@email.si> wrote in message
news:eU*************@tk2msftngp13.phx.gbl...
Hi,

Can somebody tell me how to convince explorer that my "button" will be
pressed when I press Enter - in other words that it will be default button. Just like in windows forms. I use web form button.

Thanks,
Anton

Nov 18 '05 #4
Thanks to all.

Anton
"Saravana [MVP]" <sa******@sct.co.in.nospam> wrote in message
news:eJ**************@TK2MSFTNGP11.phx.gbl...
Check out this article for how to do this,
http://www.allasp.net/enterkey.aspx

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"Anton ml. Vaheie" <va*****@email.si> wrote in message
news:eU*************@tk2msftngp13.phx.gbl...
Hi,

Can somebody tell me how to convince explorer that my "button" will be
pressed when I press Enter - in other words that it will be default

button.
Just like in windows forms. I use web form button.

Thanks,
Anton


Nov 18 '05 #5

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

Similar topics

1
by: Billy Jacobs | last post by:
Is there a way to make a button on a web form the default button so that when the user hits the enter button the code for that button executes? I have a web page Login.aspx where I have only 1...
2
by: JP | last post by:
Hi, It's a login screen, so users enter their ID/Password and hit <ENTER> instead of clicking on Login button. But when they hit <ENTER> an Image Button gets clicked. I want to make my Login...
2
by: Bratislav Jevtic | last post by:
hi, how to make some push button default on the form? for instance, I've got 2 buttons (Submit, Cancel). submit is on the left, cancel on the right side. on enter key pressed, cancel button is...
4
by: RA | last post by:
Hi I have asp.net web app. When a user clicks the enter key when he is viewing the aspx web form, it jumps to the starting web form. How can I handle the user hitting the enter key and to...
2
by: makthar | last post by:
Thanks for taking the time to read this note Can anyone explain what went wrong and any ideas how to fix it I have a search page With three buttons few drop downs and a textbox. The search...
2
by: Flip | last post by:
On my current form, when I hit the enter key in a texbox, the form appears to resubmit itself, but it's not actually doing a submit (or so I think?). I would like to have the enter button fire the...
2
by: jonefer | last post by:
This is quite serious - for a beginner... No property setting for a default button? I just want a button on a search page to automatically be pressed when I hit the return/enter key. Somehow I...
1
by: andyrich_1 | last post by:
I have a simple form that has two submit buttons on it. The problem I have is that I want one button to be the default button when the user is filling out one section of the form and another button...
15
by: simonoficina | last post by:
Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button object has a property called "default" that can set this button like press "ENTER" key. But in the VB.net I can't find this...
0
by: thersitz | last post by:
Hi, Using aspnet3.5,VStudio 2008, VB 1.) I have a set of pages, with a search text box button within a userControl that searches across our websites and is registered in a masterpage. 2)...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...

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.