disabling default button or enter key in asp.net c#

后端 未结 4 593
Happy的楠姐
Happy的楠姐 2021-01-11 14:33

I have a form where users scan in a barcode, the barcode reader automatically enters a carriage return in the value causing the form to submit since the browser chooses the

4条回答
  •  星月不相逢
    2021-01-11 15:04

        private void textbox1_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
    

    // do nothing

            }
        }
    

    this may help you

提交回复
热议问题