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
>
查看全文
相关阅读:
ural 1028. Stars 树状数组
hoj 1110 Simply Syntax // poj 1126 Simply Syntax
hdu 1827 Summer Holiday // tarjan求缩点
hoj 3005 Game Rigging 强联通分量求缩点
hoj 2741 The Busiest Man // 强连通分支+缩点+传递闭包
poj 2488 A Knight's Journey 回溯
hoj 1520 The Bottom of a Graph // poj 2553 The Bottom of a Graph
单链表的操作C语言实现(转)
UltraEdit 提示 希望转换xxx 到DOS格式吗?
linux 下查看服务 服务运行级别(转)
原文地址:https://www.cnblogs.com/LCX/p/563903.html
最新文章
Software Engineering
HRESULT 数据类型和显示错误信息
软件项目管理
(C/C++)Windows Data Type
(VC/MFC) CListBox类 和 Listbox控件
C,C++ 的字符串和操作.
Return to the Basic 模板(template)
hadoop命令
(转)hadoop的task运行完成后清理local目录影响性能
怎样才能成为一个浪漫的人
热门文章
mysql 命令
hive 插入列的问题
hive 摘记
hive 更改表名后,java程序执行hivesql出错
(转)Linux下查看文件和文件夹大小
(转)TaskTracker由于运行过多task导致内存不足而挂掉的处理办法
(转)hive 查询显示列名 及 行转列显示
2008 北京区域赛 ping pong // icpc 4329 ping pong
poj 1002 4873279 // hoj 1347 4873279
ural 1008 Image Encoding BFS
Copyright © 2011-2022 走看看