AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 Enter key and second button click event??
Posted by Ankur Dagar on  1/6/2010 6:43:06 AM Category: Asp.Net 2.0
Add to my favorites
Email to friend
I have three txtboxes and 3 buttons corresponding to those textboxes...

when i am writing in 1st textbox and hit the enter key it activate the 1st button click event
but while i am writing in 2nd textbox and hit enter it will activate the 1st button click event but i want to click that button whose textbox is inb used at that time.....

like if am in first text box then after hitting enter key , 1st button is clicked..
if i am using second one then second button is clicked after hitting enter key...
I have used tab index but nothing happens.....

plz help me out.....

Post Your Reply Post New Question

 Viewer's Reply
Setting Default Button Click for Corresponding Text Using Panel Control
Answered By Moderator1 on 1/6/2010 8:18:15 AM
Hi

Its very easy. Place a Panel control, then put your Textbox1 and Button1 inside it and set the DefaultButton property of Panel control as "Button1". Place second panel control and put the TextBox2 and Button2, then set the DefaultButton property as "Button2" and do the same for TextBox3.
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
The JavaScript Anthology: 101 Essential Tips, Tricks & Hacks - Free 158 Page Preview
Backup and Recovery Best Practices for Microsoft SQL Server 2005
When Good HTML Goes Bad: How You Can Protect Your Web Applications