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
>
查看全文
相关阅读:
线程
unix架构
Unix命令
可重入函数reentrant function
Eclipse 中 program arguments 与 VM arguments 的区别
Java中Generics的使用
Java的Reflection机制
Java按值传递、按引用传递
Java label
LeetCode Merge Intervals
原文地址:https://www.cnblogs.com/LCX/p/563903.html
最新文章
luogu1312
CF 1041 1042整理
CF980E
codevs3044
luogu T40984Chino的成绩
Codevs1541[USACO]围墙涂色
luogu2258
高精板子
51nod 1636
P3372 【模板】线段树 1
热门文章
P1955 [NOI2015]程序自动分析
P2587 [ZJOI2008]泡泡堂
P3074 [USACO13FEB]牛奶调度Milk Scheduling
NYOJ 1000 又见斐波那契数列
P1349 广义斐波那契数列
P1315 观光公交
P1306 斐波那契公约数
P3986 斐波那契数列
P1962 斐波那契数列
序列化
Copyright © 2011-2022 走看看