ASP.NET - Text box values gets cleared on hitting ENTER instead of submit button

Asked By karur krishna madhu on 22-Apr-14 02:53 AM
I have a web form after entering the values and instead of clicking on submit button if the user hits enter then all the values are getting cleared in the text boxes. what could be the issue? I believe the form is getting resubmitted and it is loading fresh.
Robbe Morris replied to karur krishna madhu on 24-Apr-14 09:15 AM
Your code is repopulating it on postback in the Page_Load event because you are expecting the Submit_Click event to fire and it isn't in this case when the postback occurs.