日期:2014-05-16  浏览次数:20541 次

在母版页下,jquery.validate的remote不起作用吗?
$('#form1').validate({
                rules: {
                    <%=txtUserName.UniqueID %>: {
                        required: true,
                        minlength: 3,
                        remote: "../Ajax/ValidateUserName.aspx"
                    }
            })
        })

代码如上,之前没有放入母版页还好好的,后来添加了母版页,放到<asp:content>中,把txtUserName换成了<%=txtUserName.UniqueID %>,remote就不起作用了。在ValidateUserName.aspx页面设置断点,根本没进来。
请问应该怎么改?
------解决方案--------------------
remote: "../Ajax/ValidateUserName.aspx"
注意路径

如果你验证的页面和母板页不在同一文件夹下的话,这里的路径引用可能就是正确,请确认。