Avoid setting focus in .net page
I have a .net page with following markup:
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" />
<asp:TextBox ID="TextBox2" runat="server" ></asp:TextBox>
<asp:Button ID="Button2" runat="server" />
When I view the开发者_Python百科 page in browser, I noticed that the first button has the focus. I want to avoid this, so I set focus on something else in code behind. Then secondly I noticed that when clicking in a textbox, the first button gets the focus again. I would like to avoid all the "focus setting" altogether, is there a way?
Have a look at this article
It is important to realize that this behavior is also dependent on the browser.
精彩评论