>> 不抱怨,不妒忌,潇洒做自己!

Asp.net中文本框全选的实现

一、鼠标滑过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()");

posted @ 2009-12-01 17:52  loose_went  阅读(951)  评论(1编辑  收藏  举报