zoukankan
html css js c++ java
CustomValidator控件原来还可以这样用。
没看到自己还不知道这种方法。
<%
@ Page Language
=
"
VB
"
AutoEventWireup
=
"
false
"
CodeFile
=
"
Default.aspx.vb
"
Inherits
=
"
_Default
"
%>
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
<
head
runat
="server"
>
<
title
>
无标题页
</
title
>
<
script
type
="text/javascript"
>
<!--
//
--><![CDATA[//><!--
function
ValidationFunctionName(source, arguments)
{
var
infoBoard;
infoBoard
=
document.getElementById(
"
backMsg
"
);
infoBoard.innerText
=
'查询中
';
var
userName
=
document.getElementById(
"
UserName
"
);
var
oBao
=
new
ActiveXObject(
"
Microsoft.XMLHTTP
"
);
oBao.open(
"
Get
"
,
"
Check.aspx?username=
"
+
userName.value,
false
);
oBao.send();
var
strResult
=
oBao.responseText;
//
如果返回 1 就代表可以使用,否则不能通过验证
if
(Number(strResult)
==
1
)
arguments.IsValid
=
true
;
else
arguments.IsValid
=
false
;
//
infoBoard.innerText='提示2';
}
//
--><!]]></script>
</
head
>
<
body
>
<
form id
=
"
form1
"
runat
=
"
server
"
>
<
div id
=
"
backMsg
"
></
div
>
<
div
>
<
asp:TextBox ID
=
"
UserName
"
runat
=
"
server
"
></
asp:TextBox
>
<
asp:CustomValidator ID
=
"
CustomValidator1
"
runat
=
"
server
"
ControlToValidate
=
"
UserName
"
ClientValidationFunction
=
"
ValidationFunctionName
"
ErrorMessage
=
"
被注册的用户名
"
></
asp:CustomValidator
>
<
asp:Button ID
=
"
Button1
"
runat
=
"
server
"
Text
=
"
Button
"
/><
br
/>
</
div
>
<
asp:TextBox ID
=
"
TextBox1
"
runat
=
"
server
"
></
asp:TextBox
>
</
form
>
</
body
>
</
html
>
查看全文
相关阅读:
2013第38周日Java文件上传下载收集思考
2013年第38周六这一刻,行动
2013年9月20日突然的焦虑
2013中秋
2013第38周三
2013年第38周二
2013第38周一电话开会邮件
for循环中一个不容小觑的问题
NPOI 创建Excel,数据读取与写入
linux下mysql数据的导出和导入
原文地址:https://www.cnblogs.com/LCX/p/563903.html
最新文章
Javascript作用域问题的构造函数的变量
poj2386 Lake Counting(简单DFS)
[转] 使用SVN进行源码管理
ArcObject开发,程序编译通过,但无法启动的解决
ARCGIS 二次开发可以参考的资源(长期更新)
ArcGIS 开发时,解决__类型“XX”同时存在于“”和“”中__的错误
ArcObject开发,“异常在 ESRI.ArcGIS.Version.dll”错误
Android开源项目总结
使用Eclipse+Maven+Jetty构建Java Web开发环境(几个教程综合集成2014发行)
数学思想方法-sasMEMO(17)
热门文章
设置韩澳大利亚sinox弄winxp清除字体和界面美观
我学的是设计模式的视频教程——装饰图案,装饰图案VS代理模式
Linux GPIO 注册和应用
hdu4864Task(馋)
cocos2d-x注意事项(十)Lua发展飞机战争-4-创建主角
eclipse 构造 C++ 11 -- ubuntu 12.04
高速分拣函数模板
2013年第39周三
2013第39周二杂记
2013第39周一Web打印
Copyright © 2011-2022 走看看