一、鼠標滑過textbox全選
前台:
<asp:TextBox runat="server" onMouseOver="this.focus();this.select()">dsdsds</asp:TextBox>
或
<asp:TextBox runat="server" onMouseOver="this.focus()" onFocus="this.select()">dsdsds</asp:TextBox>
後台:
this.txtbox1.Attributes.Add("onMouseOver", "this.focus();this.select();");
二、得到焦點
後台:
textbox1.Focus();
textbox1.Attributes.Add("onfocus","this.select()");