Click to See Complete Forum and Search --> : Default buttons
Buzby
Oct 8th, 2002, 10:44 AM
I expect this has been answered before - but how do I set a button to be 'default' on an ASP.NET page? Do I need to do some Javascript (I have very very very little experience of Javascript) or is there a better way?
I can't believe M$ released .NET without a default button property...
:rolleyes:
Musician
Oct 8th, 2002, 03:13 PM
What do you mean by default button? If you mean what button is clicked when you press enter you must bear in mind that you are dealing with html at the end of the day and an asp.net page cannot behave any differently.
Pressing enter on an html form will post it back regardless unless of cours you add in some javascript to overide the behaviour but that is beyond the scope of asp.net.
Buzby
Oct 9th, 2002, 04:22 AM
For example, I have a ASP.NET form with various buttons on it. I want one of them to be the button that is clicked when you press ENTER. At the moment ASP.NET appears to pick whichever one it feels like - there doesn't seem to be anyway to choose it (tab order or anything).
If I need to use some JavaScript then so be it - can you tell me what I need to do in JavaScript to achieve this.
Buzby
Oct 9th, 2002, 06:13 AM
Found a *FREE* tool to do it:
http://www.metabuilders.com/Tools/DefaultButtons.aspx
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.