|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Use Enter as default keyHello,
I've developed an ASP.NET page with some controls on it. One of the controls is an imagebutton. Can I assign the Enter-key to this button, so when a user presses the Enter key, the click-event will fire? I know there's a accesskey property, but this is for ALT plus the key that is entered. I would like to use the Enter key. Greetings, Chris. *** Sent via Developersdex http://www.developersdex.com *** You can assign the onkeypress event (from the DHTML Object Model) to trigger
a button's click event using JavaScript. I have a demo that explains how to set a page's default submit button and default buttons for each other section on the web page: http://www.societopia.net/samples/ASPPage_Buttons.aspx Show quoteHide quote "Chris Zopers" wrote: > Hello, > > I've developed an ASP.NET page with some controls on it. One of the > controls is an imagebutton. Can I assign the Enter-key to this button, > so when a user presses the Enter key, the click-event will fire? I know > there's a accesskey property, but this is for ALT plus the key that is > entered. I would like to use the Enter key. > > Greetings, > Chris. > > *** Sent via Developersdex http://www.developersdex.com *** > If you are using ASP.NET 2.0, it is easy. Just set the DefaultButton
property on a Panel or on the <form runat="server" defaultbutton=""> Grtz, Wouter van Vugt Trainer - Info Support http://blogs.infosupport.com/wouterv
Changed property values not reflected in DesignMode
Hide Menu Items Based On Roles TypeConverter Question ASP.NET 2.0 sort DataList without query again multiple itemtemplates datalist Blank page after selection Dynamically changing LinkButton properties Strange Results From FillEllipse Expose childcontrols Discovering what event was raised |
|||||||||||||||||||||||