六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 23|回复: 0

ajax扩展控件(9)

[复制链接]

升级  36.35%

563

主题

563

主题

563

主题

探花

Rank: 6Rank: 6

积分
1727
 楼主| 发表于 2013-1-23 02:26:28 | 显示全部楼层 |阅读模式
ValidatorCallout控件,该控件用于用户控件中输入不符合格式要求的内容之后,提示操作错误信息。

<div style=""><%...@PageLanguage="C#"AutoEventWireup="true"CodeFile="ValidatorCalloutDemo.aspx.cs"
Inherits
="ValidatorCalloutDemo"%>

<%...@RegisterAssembly="System.Web.Extensions,Version=1.0.61025.0,Culture=neutral,
PublicKeyToken=31bf3856ad364e35
"
Namespace
="System.Web.UI"TagPrefix="asp"%>

<%...@RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="cc1"%>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>

<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title>无标题页</title>
</head>
<body>
<formid="form1"runat="server">
<div>
<asp:ScriptManagerID="ScriptManager1"runat="server">
</asp:ScriptManager>
<table>
<tr>
<td>电子邮件:</td>
<td><asp:TextBoxrunat="server"ID="MailTextBox"BorderStyle="solid"
BorderWidth
="1px"BorderColor="#a9a9a9"/></td>
</tr>
</table>
<br/>
<asp:RegularExpressionValidatorrunat="server"ID="PNRegEx"
ControlToValidate
="MailTextBox"Display="None"ErrorMessage="<b>格式不正确</b><br/>请按如下格式填写<br/>carol@sina.com"ValidationExpression="w+([-+.']w+)*@w+([-.]w+)*.w+([-.]w+)*"/>
<asp:ButtonID="Button1"runat="server"Text="提交"/>
<cc1:ValidatorCalloutExtenderrunat="Server"ID="PNReqE"TargetControlID="PNRegEx"
Width
="100px"/>
</div>
</form>
</body>
</html>
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表