asp.net MVC 3服务器端的远程验证工作不通过的提琴手提交 [英] asp.net mvc 3 serverside remote validation not working on submit through fiddler

查看:170
本文介绍了asp.net MVC 3服务器端的远程验证工作不通过的提琴手提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解如何验证工作的远程。它的伟大工程客户端或浏览器。这是我做什么,我需要检查是否同时存在注册一个用户名。所以我加了远程验证,并在浏览器中完美。我想测试它提交的,所以我在拍摄的小提琴手的要求,改变了用户名的东西存在,然后提交请求。它接受。 RemoteValidation没有发生(当然它没有在DB)。因此,不存在服务器上验证一面?


解决方案

  

因此​​,不存在服务器上验证一面?


没有,当然,它并没有在服务器上进行验证。当你修改了相应的输入值,但是当提交表单时,你显然不应该再进行一次此验证这只是一个AJAX调用。

I am trying to understand how remote validation works. It works great client side or in browser. This is what I did, I need to check if a username exists while registration. So I added remote validation and it worked perfectly in browser. I wanted to test it on submit, so I captured the request in Fiddler and changed the username to something that exists and then submitted the request. It accepted. RemoteValidation did not occur (of course it failed at db). Hence doesn't it validate on server side?

解决方案

Hence doesn't it validate on server side?

No, of course that it doesn't validate on the server. It's just an AJAX call when you modify the value of the corresponding input but when the form is submitted you should obviously perform this validation once again.

这篇关于asp.net MVC 3服务器端的远程验证工作不通过的提琴手提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆