Enter in Textbox reloads page instead of submitting form
I'm sure this is simple and there's plenty of close-but-not-quite posts...
I've got a content page containing a LoginView which has got a Textbox and Button on the AnonymousTemplate. I enter "123" in the Textbox and press enter, the page reloads (I've put a trace in the Page_Load event) and the Textbox still contains "123". If I press my Button instead of pressing enter while in the Textbox, it works as I would expect. I've tried adding
Code:
ClientScript.RegisterHiddenField("__EVENTTARGET", "MyButtonName");
(suggested instead of Page.RegisterHiddenField by my compiler) but that made no difference.
What's going on? How do I get the expected behaviour instead of a page reload?
Thanks for your help!
Some cause happiness wherever they go; others, whenever they go.