20090928

ASP.NET form submit on enter.

One of the more frustrating things, form submit that happens on enter key press anywhere in the web page. It was messing up some of my AJAX posts.

Solution, add a default button to the form (up the page chain to the initial master), add that button.

Like So:
<form id="form1" runat="server" defaultbutton="btnDefautNothing"/>

<asp:button id="btnDefautNothing" runat="server" visible="true" text="Nothing" style="display: none;" onclientclick="return false;" />

Should save some frustration.

No comments:

Post a Comment