惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
T
Tenable Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
W
WeLiveSecurity
D
DataBreaches.Net
Attack and Defense Labs
Attack and Defense Labs
H
Heimdal Security Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
AI
AI
P
Proofpoint News Feed
PCI Perspectives
PCI Perspectives
Schneier on Security
Schneier on Security
T
Threatpost
GbyAI
GbyAI
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
H
Help Net Security
F
Full Disclosure
T
Threat Research - Cisco Blogs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
M
MIT News - Artificial intelligence
L
Lohrmann on Cybersecurity
Martin Fowler
Martin Fowler
博客园 - 【当耐特】
Y
Y Combinator Blog
腾讯CDC
The Hacker News
The Hacker News
博客园 - Franky
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园_首页
Simon Willison's Weblog
Simon Willison's Weblog
L
LINUX DO - 最新话题
Security Latest
Security Latest
Know Your Adversary
Know Your Adversary
Forbes - Security
Forbes - Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
SegmentFault 最新的问题
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
L
LangChain Blog
Vercel News
Vercel News
Cisco Talos Blog
Cisco Talos Blog
量子位
P
Proofpoint News Feed
H
Hacker News: Front Page
Help Net Security
Help Net Security
L
LINUX DO - 热门话题
Project Zero
Project Zero
C
Cisco Blogs

博客园 - 红色石头

删除表中多余的重复记录 c#里正则表达式的例子 水晶报表中动态显示图片 Javascript中定义类 - 红色石头 - 博客园 castle实例分析(二) castle实例分析(一) url传递中文的方法 - 红色石头 - 博客园 水晶报表中设定每页显示的行数 服务器控件Table的使用 asp.net2.0中关于ASP.NET 网站管理工具无法连接sql server 数据库的处理 转载一张有趣的图片 动态添加用户控件和服务器控件(二) 动态添加用户控件或服务器控件(一) XML格式的字符串和DataSet之间的相互转换 SQL Server2005关于web服务的配置 在VS2005中用C#写存储过程 控制模版列的文本框在编辑时只读 利用.net正则表达式化繁为简的一个实例 利用SqlServer2005的新增函数实现更高效的分页存储过程
控制模版列的文本框只能输入数字并且禁止粘贴
红色石头 · 2006-11-01 · via 博客园 - 红色石头

方法一:
html中加控制输入数字的Js函数
function LimitNumber(obj)
  {
   obj.maxLength = 20;
   if (!(((window.event.keyCode >= 48) && (window.event.keyCode <= 57))
   || (window.event.keyCode == 46)|| (window.event.keyCode == 45)))
   {
    window.event.keyCode = 0;
   }
  }

模版列中
<asp:TextBox onkeypress="LimitNumber('txtSqf')" onpaste="return false" id=txtSqf
runat="server" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem.Sqf") %>'>
方法二:
         因为方法一无法避免中文输入问题,有待继续改进。方法二采用服务器端控件简单的方式实现。只需在模版列中为文本框加入RegularExpressionValidator控件,正则表达式为^(-?\d+)(\.\d+)?$。