Default Button

  • Thread starter Thread starter A.M
  • Start date Start date
Hi Alan,

As for how to make a Button control as the default button on a asp.net
webform page, there is no buildin means for setting default button. We can
use javascript code to let a certain button be clicked when we press
"enter" key on a textbox. Here are some tech articles and former threads
discussing on the same question:

TA:
http://www.kamp-hansen.dk/pages/showdoc.asp?id=28&menuid=21&menuid=18

http://www.metabuilders.com/tools/DefaultButtons.aspx

http://www.allasp.net/enterkey.aspx

FT:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=CyvtFHT8DHA.1152%
40cpmsftngxa07.phx.gbl&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26
q%3Denter%2Bkey%2Bsteven%2Bcheng

Hope helps. Thanks.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
//you can use document.getElementById("buttonname").focus();
window.onload=function(){
document.getElementById("buttonname").focus();
}
 
Hi Alan,

Have you had a chance to check out the suggestions in my last reply or have
you got any further ideas on this issue? If you have anything unclear or if
there're anything else we can help, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Back
Top