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
>
查看全文
相关阅读:
Sign Distance Field 2
矩阵相乘优化
Editor GUI 的 Gamma Correction
GPUSkinning 5
GPUSkinning 2
RenderTextureFormat.ShadowMap
战争迷雾
Texture2DArray(2)
软件渲染器 YwSoftRenderer
将 Unity5.3 的老项目升级到 Unity 2018.3 遇到的些许问题。
原文地址:https://www.cnblogs.com/LCX/p/563903.html
最新文章
虚拟机字节码执行引擎(二)
虚拟机字节码执行引擎(一)
JVM垃圾回收(六)
JVM垃圾回收(五)
JVM垃圾回收(四)
JVM垃圾回收(三)
JVM垃圾回收(二)
JVM垃圾回收(一)
fiddler抓包工具使用图文教程
JQUERY实现的小巧简洁的无限级树形菜单
热门文章
JQuery实现动态生成树形菜单
css 变手
图片平滑效果
UEditor编辑器和php简单的实现socket通信
PHP 可以获取客户端哪些访问信息
【discuz】G变量注解之 $_G['member'] 全局当前登录者信息
jQuery倒计时实例
九宫格大转盘抽奖
Slab-based Intersection
UE4 的 kDopTree
Copyright © 2011-2022 走看看