Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 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 November 21st, 2007, 11:27 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default enter key should execute button click event

i have a text box and a button in my form. when user enters mailid in textbox and click on button then file download. but if user enter mail id and just press enter button_click event does not fire. which is what i need. how to perform it.


thanks......
__________________
thanks......
 
Old November 22nd, 2007, 07:21 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 107
Thanks: 1
Thanked 8 Times in 7 Posts
Default

Hi,

Can you check that the button takes the focus in the form you are submitting after the entry of the text box?

You may need to change the display/entry order.



 
Old November 22nd, 2007, 10:23 AM
Authorized User
 
Join Date: Jan 2007
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aliirfan84
Default

Dear,

Just added following line of code in your text box's (onKeyDown) opening tag:

<asp:textbox id="id" runat="server" onKeyDown="if (event.keyCode == 13) {btnName.click();return false;}

Hope it will work fine.

Regards,
Ali Irfan
 
Old November 23rd, 2007, 10:10 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

thanks for help, but i want from any text box if i press enter key, click event should fire.
should i write this code in all controls.

thanks......
 
Old November 23rd, 2007, 10:15 AM
Authorized User
 
Join Date: Nov 2007
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just add the panel at the top of the html code and inside the panel place the controls and end the panel tag

<asp:Panel ID="Panel1" runat="server" DefaultButton="theidofthebuttonyouwanttoexceute">

your controls should come here.

</asp:Panel>

That's it. It will execute the button click event.

 
Old November 23rd, 2007, 10:19 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

thanks it also sounds better. please continue discussion of above solution also.

thanks......
 
Old November 25th, 2007, 10:59 PM
Friend of Wrox
 
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

How does a panel render client side? I've heard people talk about it once in awhile, but I've never used one. Does it render as a div? a table? and what's the functionality that makes it desirable as opposed to just using a div or table with a runat="server"?

-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Enter key and double click help... badboy1 ASP.NET 3.5 Basics 0 July 27th, 2008 03:58 AM
Enter Key Event (Enter Key Only) Coby Excel VBA 0 February 6th, 2008 09:55 PM
enter key on textbox, performs button event code?? squeakstar Visual Basic 2005 Basics 4 June 22nd, 2006 05:13 AM
Enter key vs Click Button akibaMaila VB.NET 2002/2003 Basics 1 January 14th, 2005 12:49 PM
Enter Key event handler KevinO ASP.NET 1.0 and 1.1 Basics 2 August 17th, 2004 09:57 AM





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