Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fire an ASP.NET TextBox event on enter press

How do i fire a ASP.NET click event when the user press enter.

This is what i do now but it does not work:

function KeyDownHandler(event) {
    if (event.keyCode == 13) {
        __doPostBack('<% ButtonGetListforUser.ClientID %>', 'OnClick');
        isClicked = true;
    }
}
like image 656
Kimtho6 Avatar asked Dec 02 '25 20:12

Kimtho6


1 Answers

Try to use the Panel.DefaultButton Property

like image 72
Oleg Kalenchuk Avatar answered Dec 04 '25 09:12

Oleg Kalenchuk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!