I was creating a search page and I require that when user press enter key, by default search button’s click event should be fire. I look around for the solution and find the easiest one. You just need to write below line in page load of your code behind file.
Form.DefaultButton = btnSubmit.UniqueID;
Here btnSubmit is the name of button.
Happy Programming!!!!
[...] 11, 2009 by chiragrdarji In my previous post I mentioned the one way to set default button in ASP.NET. There are few other methods also. [...]