一、鼠标滑过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()");
本文转自loose_went博客园博客,原文链接:http://www.cnblogs.com/michaelxu/archive/2009/12/01/1614762.html,如需转载请自行联系原作者