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
>
查看全文
相关阅读:
linux 下载openssl 亲测有效
在linux文件中 怎么查看文件的行数
linux 安装mysql 数据库
bccomp
javascript之date
javascript之函数
JavaScript数据类型之数组
BOM
canvas
javascript数据类型之对象
原文地址:https://www.cnblogs.com/LCX/p/563903.html
最新文章
Jenkins使用教程之管理节点
Jenkins使用教程之用户权限管理(包含插件的安装)
jenkins使用教程之系统设置
Jenkins使用教程之创建job
AC算法--python
版本问题---cuda和tensorflow的版本对应关系
挖掘建模
数据预处理
数据探索
test
热门文章
什么是P问题、NP问题和NPC问题
Elasticsearch--集群管理_别名&插件&更新API
Elasticsearch--集群管理_再平衡&预热
Elasticsearch--集群管理_时光机&监控
php 查看sql 语句 亲测有效
线上js
The bootstrap/cache directory must be present and writable 解决办法
Linux下全局安装composer方法
闭包函数
解决github.com 访问慢的情况
Copyright © 2011-2022 走看看