Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 23rd, 2004, 04:03 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default Pressing Enter should fire an event

Hi Experts

I have an aspx page in which I am providing a search facility apart from other matters. I have placed an image button. I have several dropdown lists and textboxes in the page to provide the search criteria. I want the imagebutton click to be fired when the user clicks the "Enter" key from anywhere in the page, even without clicking on any of the controls.

Is there any way to achive this??

Thanks in advance

Regards
Ganesh
__________________
Regards
Ganesh
http://ganeshprof.blogspot.com
Find your solution here...
 
Old September 26th, 2004, 09:47 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Take a look at this: http://www.dotnet2themax.com/ShowCon...f-d7364911b799

It's an implementation of a control that inherits from TextBox and uses some JavaScript for the postback.

If you want a demo of it, take a look here: http://www.dotmugs.ch/events/event.aspx?eid=17 (although you need to be registered to see it).

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old September 27th, 2004, 02:04 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

Thanks Imar for your response...

Actually, what I want is to the PostBack to fire whenever the user presses the "Enter" key. Not only from the textbox. When the page is loaded, if the user presses the "Enter" key, it should work as if the user clicked on the ImageButton.

Thanks

Regards
Ganesh
 
Old September 27th, 2004, 04:04 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

In that case, I think you can reuse some of the code presented in the download.

You can use body.OnKeyPress to submit the form, I think....

Cheers,


Imar
 
Old September 28th, 2004, 12:02 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

thanx Imar

Regards
Ganesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
Login Control Behavior when pressing ENTER rsearing ASP.NET 2.0 Basics 6 July 22nd, 2007 08:21 PM
Cannot get Edit Template event to fire zoltac007 ASP.NET 2.0 Professional 4 February 13th, 2007 03:29 PM
SelectedIndexChanged Event doesn't fire ddudley3 ASP.NET 2.0 Professional 7 February 6th, 2006 10:47 AM
Can't fire button event more than 1 time goatstudio ASP.NET 2.0 Basics 4 September 22nd, 2004 07:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.