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
>
查看全文
相关阅读:
克罗谈投资策略14
克罗谈投资策略13
克罗谈投资策略12
克罗谈投资策略11
克罗谈投资策略10
克罗谈投资策略09
克罗谈投资策略08
克罗谈投资策略07
克罗谈投资策略06
克罗谈投资策略05
原文地址:https://www.cnblogs.com/LCX/p/563903.html
最新文章
拥抱BIM,GIS需解决哪些关键问题
色温滤镜
Matlab电子书pdf合集
激光实现3D空气成像技术,无需屏幕
OmniGroup
自动UV平铺算法
Photoshop 图像处理算法
Image Processing Algorithms
图像处理算法
Core Image Filter Reference
热门文章
Leetcode 95.不同的二叉搜索树II
Leetcode 93.复制IP地址
Leetcode 92.反转链表
Leetcode 89.格雷编码
Leetcode 90.子集
Leetcode 87.扰乱字符串
Leetcode 86.分隔链表
Leetcode 80.删除重复数组的重复项
Leetcode 79.单词搜索
Leetcode 78.子集
Copyright © 2011-2022 走看看