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

推荐订阅源

J
Java Code Geeks
量子位
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog
A
About on SuperTechFans
腾讯CDC
The GitHub Blog
The GitHub Blog
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
Last Week in AI
Last Week in AI
H
Help Net Security
WordPress大学
WordPress大学
博客园 - 司徒正美
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
博客园 - 【当耐特】
S
SegmentFault 最新的问题
美团技术团队
M
MIT News - Artificial intelligence
L
LangChain Blog
博客园 - 聂微东

博客园 - 大厨师

DotNetNuke发布6.0版,开发语言改为C# 通过URL直接传递参数给报表服务中汉字的处理 重复文件整理 DotNetNuke 4/5 安装提示 msajax错误,下载AJAX 1.0即可解决 - 大厨师 siverlisht测试版上开发的应用程序因为和正式版兼容问题不能访问 Oracle数据库使用遇到问题记录 今天接到了微软公司最恶心的推销电话 还在为页面的兼容性苦恼? DotNetNuke模块开发简介 DotNetNuke 4.6.2 中文安装包及代码--重新做人 DotNetNuke 04.05.05 安装 卡巴司机能占多大地方? 微软推出中文版70-431,70-500考试 你能把百度搜成这样吗? 做技术的不如做广告的,还是做广告的侮辱做技术的? 关注MSDN图书中心,关注读书时代 Win2000 Win2003安装卡巴斯基6.0 微软再次发布正版验证更新 Ajax 学习,Accordion
Ajax 水印文本框
大厨师 · 2007-03-31 · via 博客园 - 大厨师

水印文本框在普通文本框中添加水印文字效果

当文本框为空的时候该控件可以使用自定义的CSS样式给用户显示某些信息。用户输入到文本框后不再显示水印文字。通常用于告诉用户文本框的一些信息而不用页面的其他地方。

TextBoxWatermark is an ASP.NET AJAX extender that can be attached to an ASP.NET TextBox control to get "watermark" behavior. When a watermarked TextBox is empty, it displays a message to the user with a custom CSS style. Once the user has typed some text into the TextBox, the watermarked appearance goes away. The typical purpose of a watermark is to provide more information to the user about the TextBox itself without cluttering up the rest of the page.

控件的属性

The control above is initialized with this code. The italic properties are optional:

<ajaxToolkit:TextBoxWatermarkExtender ID="TBWE2" runat="server"
    TargetControlID="TextBox1"
    WatermarkText="Type First Name Here"
    WatermarkCssClass="watermarked" />
  • TargetControlID - The ID of the TextBox to operate on 目标控件id
  • WatermarkText - The text to show when the control has no value 目标控件为空时显示的水印文字
  • WatermarkCssClass - The CSS class to apply to the TextBox when it has no value (e.g. the watermark text is shown). 目标文本框为空时水印文字使用的CSS样式,如上图