473,385 Members | 1,570 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,385 software developers and data experts.

default button on page

I've added a button to a search page and when the user enters in search
criteria in the search text box and hits ENTER I'd like it to behave as if
the user clicked the SEARCH button. Is there a way to set a default button
with ASP.NET?

Thanks,

John Holmes
jo****@co.skagit.wa.us
Nov 18 '05 #1
2 1957
You can intercept the client side enter keypress event of the text box and
then click do what you want using javascript code.
Here's a good example:
http://www.kamp-hansen.dk/pages/show...d=21&menuid=18

You could also try using this free control.
http://www.metabuilders.com/tools/DefaultButtons.aspx

And here's a good article on the subject:
http://www.allasp.net/enterkey.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"John Holmes" <jo****@co.skagit.wa.us> wrote in message
news:eX**************@TK2MSFTNGP12.phx.gbl...
I've added a button to a search page and when the user enters in search
criteria in the search text box and hits ENTER I'd like it to behave as if
the user clicked the SEARCH button. Is there a way to set a default button
with ASP.NET?

Thanks,

John Holmes
jo****@co.skagit.wa.us

Nov 18 '05 #2
Thanks, this solved my problem. I used the C# sample code with the TieButton
function from http://www.allasp.net/enterkey.aspx and it works.

John

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:ej**************@TK2MSFTNGP09.phx.gbl...
You can intercept the client side enter keypress event of the text box and
then click do what you want using javascript code.
Here's a good example:
http://www.kamp-hansen.dk/pages/show...d=21&menuid=18

You could also try using this free control.
http://www.metabuilders.com/tools/DefaultButtons.aspx

And here's a good article on the subject:
http://www.allasp.net/enterkey.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"John Holmes" <jo****@co.skagit.wa.us> wrote in message
news:eX**************@TK2MSFTNGP12.phx.gbl...
I've added a button to a search page and when the user enters in search
criteria in the search text box and hits ENTER I'd like it to behave as if the user clicked the SEARCH button. Is there a way to set a default button with ASP.NET?

Thanks,

John Holmes
jo****@co.skagit.wa.us


Nov 18 '05 #3

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: Goober | last post by:
I have the following default.aspx page that works properly. However, what I want to do is to link the graphics within it (that are hard coded now in the default web page) to our corporate...
4
by: tshad | last post by:
I have 3 objects on my page (textbox,button and linkbutton) When I put something in my textbox and hit "enter", the page gets posted, but nothing happens. I don't go to either of the functions...
1
by: JJ | last post by:
I have two related problems: (a). trying to set the default button within a CreateUserWizard control ----------------------------------------------------------------- I've done this in a messy...
1
by: JJ | last post by:
What trouble I'm having setting default buttons on a page (with a master page). I got around doing it on a page basis by calling the SetWizardDefaultButton() routine from page load. Notice how...
2
by: Gregory Gadow | last post by:
I have a large website written to use ASP.Net 2.0. The master page has a "logout" button. If the child page does not have an explicitly defined default button (most do not), the page posts back...
2
by: AlecL | last post by:
Hi All, I have added a user control onto an aspx page and want to make the submit button of that user control the default button when the panel in which the user control is located is visible. ...
0
by: Glenn | last post by:
I currently have a page that contains a logon control and a Wizard control. I am having an issue when the user hits the "Enter" key, the user gets logged off. This is because the logon control...
0
by: =?Utf-8?B?bmVlcmFqYkBub2lkYS5ub3NwYW1oY2x0ZWNoLmNv | last post by:
Hi, We have created new .NET web service and running it through the default test page and it's working fine in our development environment. When we moved the web service to the acceptance...
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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.