Yesterday I was building a small webapplication for a client. The user had to enter a code to retrieve some data. So I added a Label, a TextBox and a Button. I wrote my code tested it and it worked. I wanted to show it to the customer and suddenly it didn’t work??
Hmmm strange, I tried it a couple of times, still the same. Then I did it step by step. I filled in the code, pressed the button and voila there was the desired effect?
What was the problem? Well it seems that in the internet explorer version I had, when I filled the TextBox and pressed the enter button instead of clicking on the mouse button, the event of the login button pressed didn’t get fired. Firefox on the other hand tends to do press the submit button if you do the same actions. So you are on a textfield, enter some data and then hit the enter button. It will press the real form button, if there are more than one (like you have in asp.net appz) you have to take notice that the right ones backend action gets submit.
How did I fixed this, simple just hooked op the OnTextChange event with the same EventHandler of the ButtonPressed.
So if you do asp.net dev, please do check your browsers and don’t only trust the debugging sessions with your iexploder.
Also if haven’t heared about it yet, you should really checkout the firebug beta plugin for firefox (It wasn’t available on my ubuntu using apt-get, so you should install it from the xpi!)