tags:

views:

257

answers:

1

Can we use it like this...

<% using (Html.BeginForm("PerformSearch", "ClientSearch", FormMethod.Post, new { defaultbutton = "btnSearch" })) %>

Basically I want the enter key to raise the onClick event of btnSearch. This button is just a button, not a submit button.

+1  A: 

One of the beauties of MVC in .NET is that it lets you easily write your own JavaScript helpers, which what you need to do in this case. Just write a simple function that binds the 'enter' key press to a click event on that button on pageload.

Josh