Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 21st, 2007, 11:27 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
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......
  #2 (permalink)  
Old November 22nd, 2007, 07:21 AM
Friend of Wrox
 
Join Date: May 2006
Location: Northampton, United Kingdom.
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.



  #3 (permalink)  
Old November 22nd, 2007, 10:23 AM
Authorized User
 
Join Date: Jan 2007
Location: Islamabad, Punjab, Pakistan.
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
  #4 (permalink)  
Old November 23rd, 2007, 10:10 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
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......
  #5 (permalink)  
Old November 23rd, 2007, 10:15 AM
Authorized User
 
Join Date: Nov 2007
Location: , , .
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.

  #6 (permalink)  
Old November 23rd, 2007, 10:19 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

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

thanks......
  #7 (permalink)  
Old November 25th, 2007, 10:59 PM
Friend of Wrox
Points: 1,749, Level: 16
Points: 1,749, Level: 16 Points: 1,749, Level: 16 Points: 1,749, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
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.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:06 AM.


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