开发者

Avoid setting focus in .net page

开发者 https://www.devze.com 2023-03-25 16:08 出处:网络
I have a .net page with following markup: <asp:TextBox ID=\"TextBox1\" runat=\"server\"></asp:TextBox>

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消