jquery.validate remote BUG

test1.aspx

<%@ Page Language="C#" %>

<script runat="server">
protected void btnTest_Click(object sender, EventArgs e)
{
this.Title = "你这个臭虫!" + DateTime.Now.Ticks.ToString();
//txtName.Focus();
}

protected override void OnLoad(EventArgs e)
{
if (!IsPostBack)
{
System.Web.HttpContext.Current.Response.Expires = 0;
System.Web.HttpContext.Current.Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);
System.Web.HttpContext.Current.Response.AddHeader("pragma", "no-cache");
System.Web.HttpContext.Current.Response.CacheControl = "no-cache";

string act = Request.QueryString["act"] ?? "";

if (act == "test")
{
Response.Clear();
Response.Write("true");
Response.End();
}
}
}
</script>
<!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 src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"
type="text/javascript"></script>
<script type="text/javascript">
$(function () {

$('#form1').validate({
rules: {
txtName: { maxlength: 200, required: true, remote: 'test1.aspx?act=test' }
},
messages: {
txtName: { remote: '已存在' }
}
});
});

</script>
</head>
<body>
<form id="form1" runat="server">
<p>
<label>
名称:<asp:TextBox ID="txtName" runat="server"></asp:TextBox></label>
</p>
<p>
<label>
下拉多选:
<asp:ListBox ID="txtSource" DataValueField="ID" DataTextField="Name" runat="server"
SelectionMode="Multiple">
<asp:ListItem>hh1</asp:ListItem>
<asp:ListItem>hh2</asp:ListItem>
<asp:ListItem>hh3</asp:ListItem>
<asp:ListItem>hh4</asp:ListItem>
<asp:ListItem>hh5</asp:ListItem>
<asp:ListItem>hh6</asp:ListItem>
</asp:ListBox>
</label>
</p>
<p>
<asp:Button ID="btnTest" runat="server" Text="提交" OnClick="btnTest_Click" /></p>
</form>
<pre>
1.点击“提交”按钮。出现“你这个臭虫!”。[<a href="test1.aspx">test1.aspx</a>]

2.点击“提交”按钮,出现“你这个臭虫!”,再点“<b>提交</b>”按钮,为什么就出不来呢??[<a href="test1.aspx">test1.aspx</a>]

3.点击“提交”按钮,出现“你这个臭虫!”,把焦点移到“名称”,再点“提交”,才可以连续提交。这个算BUG吧?![<a href="test1.aspx">test1.aspx</a>]
</pre>
</body>
</html>

 

posted on 2011-12-30 02:03  wm41  阅读(497)  评论(0编辑  收藏  举报

导航