By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,286 Members | 2,443 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,286 IT Pros & Developers. It's quick & easy.

Default button mapped to the Enter key would be "Submit"

P: n/a
I have got a couple of Serverside Button Controls in a page. Each button performs different actions, e.g. Button1 performs Submit, Button2 performs Cancel etc. Now, I want the default button mapped to the Enter key would be "Submit". I know a couple ways to achive this functionality using html buttons. But, how to achieve this functionality with Serverside buttons? Any idea

Thanks in advance

Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
you could make the button focus on page load with javascript -
Button1.focus();

You could also set the TabIndex to 1 to make it the 1st control in the tab
order.

Simon

"Sanjeeb Sarangi" <an*******@discussions.microsoft.com> wrote in message
news:84**********************************@microsof t.com...
I have got a couple of Serverside Button Controls in a page. Each button performs different actions, e.g. Button1 performs Submit, Button2 performs
Cancel etc. Now, I want the default button mapped to the Enter key would be
"Submit". I know a couple ways to achive this functionality using html
buttons. But, how to achieve this functionality with Serverside buttons? Any
idea?
Thanks in advance.

Nov 18 '05 #2

P: n/a
hi Sanjeeb,

If you place this line of code within

Page.RegisterHiddenField("__EVENTTARGET", "btnLogin")

where btnLogin is the name of control that you wish to fire by default.

Hope this helps

ian

"Sanjeeb Sarangi" <an*******@discussions.microsoft.com> wrote in message
news:84**********************************@microsof t.com...
I have got a couple of Serverside Button Controls in a page. Each button performs different actions, e.g. Button1 performs Submit, Button2 performs
Cancel etc. Now, I want the default button mapped to the Enter key would be
"Submit". I know a couple ways to achive this functionality using html
buttons. But, how to achieve this functionality with Serverside buttons? Any
idea?
Thanks in advance.

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.