Submitting ASP.NET form with enter key (Actual Post from http://www.bloggidity.com/web/2004/01/18/submitting_asp_net_form_189.htm) - Riaan's Blog

Submitting ASP.NET form with enter key (Actual Post from http://www.bloggidity.com/web/2004/01/18/submitting_asp_net_form_189.htm)

This has got to be the wierdest fix I've ever seen, but it works. I was completely puzzled as to why my search button would -not- work when I entered data and hit enter. It would just not do anything. Then I read this article on Matt Berther's blog:

For the last few hours, I've been trying to figure out why my event handler is not being hooked up when I hit the ENTER key to submit my ASP.NET form.

As it turns out, this is a bug with ASP.NET. If you're not aware of this, the work around is to insert an invisible *HTML* textbox (an asp:TextBox wont work).

Add this line somewhere on the page:

, and all will work as expected.

Read more here:

http://www.bloggidity.com/web/2004/01/18/submitting_asp_net_form_189.htm

 

(Actual Post from http://www.bloggidity.com/web/2004/01/18/submitting_asp_net_form_189.htm)

Published 24 March 2005 11:47 AM by riaan

Comments

No Comments

Search

Go

This Blog

Syndication