Asp.net 文本框全选的实现

yipeiwu_com5年前PHP代码库
一、鼠标滑过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()");

相关文章

php调用C代码的实现方法

在php程序中需要用到C代码,应该是下面两种情况: 1 已有C代码,在php程序中想直接用2 由于php的性能问题,需要用C来实现部分功能 针对第一种情况,最合适的方法是用system调...

php curl 获取https请求的2种方法

今天一个同事反映,使用curl发起https请求的时候报错:“SSL certificate problem, verify that the CA cert is OK. Detail...

php简单实现单态设计模式的方法分析

本文实例讲述了php简单实现单态设计模式的方法。分享给大家供大家参考,具体如下: 单态设计模式通常包含以下三点: · 一个私有的 构造方法;(确保用户无法通过创建对象对其进行实例化) ·...

URL Rewrite的设置方法

URL Rewrite需要服务器的支持!在启用此设置之前,请确保服务器上已作出了正确的设置,设置方法请参看下边的“Apache下的设置方法”和“IIS下的设置方法”!Apach...

PHP关于htmlspecialchars、strip_tags、addslashes的解释

PHP的htmlspecialchars、strip_tags、addslashes是网页程序开发中常见的函数,今天就来详细讲述这些函数的用法: 1.函数strip_tags:去掉 HT...