Set the default focus button in ASP.NET 2.0

xiaoxiao2021-03-06  24

In ASP.NET 1.1, when you want to set a control as the default focus button (that is, the default focus is on this control), you may use the JavaScript code, while in ASP.NET 2.0 In the middle, don't have these troubles, in the form code, use

DefaultButton and DefaultFocus properties can be, such as

DefaultButton = "btnsubmit"

DefaultFocus = "TextBox1"

Runat = "Server"> When the page is loaded, the default Button button is btnsubmit, the focus is on TexBox1 by default.

转载请注明原文地址:https://www.9cbs.com/read-79511.html

New Post(0)