I have a webpage with a Master. The master contains
search1Button with PostBackUrl="~/Search.aspx"
The child page contains
search2Button with onclick="btnSearch_Click"
When a user hits <enter> search1Button will execute. When nothing is active I can see how search1Button can be viewed as the default. But, when the active textbox is say
search2TextBox
Things can be a little confusing when suddenly search1Button executes instead of search2Button.
A. How does the page decide what executes?
B. Does this have anything to do with Forms? If yes, does having only 1 Form limit my ability to control the situation (I cannot add more forms due to major problems experienced by me and discussed on SO with nested forms)?
You can use the
DefaultButtonattribute of the form.