ASP.Net Default button and Master Pages
Last few days I was(am) busy with one pure ASP.Net application(why its pure because we are not using any 3rd party controls, ajax nothing. Everything is postbacking
). Today I got a weird bug from one of my QC team saying when ever they presses ENTER button, focus is on any textbox, it popups Help window from our application. In our application, end users can open the Help window, by clicking on some help images icons provided in the application. These images are displayed using ASP Image button controls (If you are using ASP Image controls this problem will not occur, but in our application, we need to disable it some scenarios, so can’t use ASP Image). After searching I found the issue with the default button property of ASP.Net, which helps us to submit the form using Enter Key. In my page ASP.Net considering the Help image button as default button for the Page. We can set the default button to our submit button using various methods. Set the default button property of the FORM, or create a Panel control over the controls and set the default button property of the Panel.
<form id="form1" runat="server" defaultbutton="cmdSubmit"> <asp:Panel runat="server" ID="plMain" DefaultButton="cmdSubmit">
Form tag also supports “defaultfocus” this property allows to focus to control, on Page Load.
<form id="form1" runat="server" defaultbutton="cmdSubmit" defaultfocus="txtUser">
If you are using Master Pages, there will be some slight difference because, the Form tag will not be available in the content Pages. It can fix using code behind, using FindControl method.
(Page.Master.FindControl("Form1") as HtmlForm).DefaultButton = this.cmdSubmit.UniqueID;
Also you can do something like this
Page.Master.Page.Form.DefaultButton = cmdSubmit.UniqueID;
Happy Coding

Thanks worked for me..
Welcome
Thanks Boss….