TextBox on GridView triggers a button click event to fire

I chased this round for several days, and he began to lead me a little bitty.

I have a text box in a Gridview that I allow to edit some data. When the enter key is pressed, the TextChanged event occurs as I expected, but then it also fires the OnClick event of the button in the form.

I tried to remove the button, and it just moved to the next button in the form, so there is something about it that makes me think that the enter key is pressed on the button.

I tried to use Google, but I do not see much. I tried the search here, but it seems pretty unusual that my searches won't catch it. Any help or suggestions would be most welcome.

+1
source share
3 answers

Try installing UseSubmitBehavior="False"on the buttons on your page.

+2
source

Change the property of the AutoPostBacktext field to true. By doing this, you also do not need to worry about any button for submitting behavior.

txtbox.AutoPostBack = true;
+1
source

, IsCancel IsDefault. , .

.

0

All Articles