This seems to be a common problem but I cannot find a solution.
I type in my username and password which are in a login control I have created. I then press enter once I’ve typed in my password and the page just refreshes. It triggers the page load event but not the button on click event.
If I press the submit button then everything works fine.
using your forms default button is correct, but you need to supply it the correct id as it will be rendered to HTML.
so you do as Jon said above:
But ensure you use the Button name that will be rendered. You can achieve this my making the Button public in your control, or a method that will return it’s ClientId.
Let’s say your button is called btnSubmit, and your implementation of your control ucLogin.
Give your form an id
Then in your page load in your code behind of your page, set the DefaultButton by handing it your button client id.