什么是不干扰Javascript验证 [英] What is is Unobtrusive Javascript Validations

查看:70
本文介绍了什么是不干扰Javascript验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我需要为我的空asp.net MVC 3应用程序进行客户端验证...

我到目前为止所知道的是,

我们可以在JavaScript文件中以函数形式编写验证,然后可以在_Layout.cshtml文件中将该函数和js文件以及CSS一起调用."

现在我的问题是在Google搜索时,我发现它是"Unobtrusive JavaScrip".

我对此不清楚.

谁能确切告诉我这是什么意思,以及我们可以使用哪种方式....

在此先感谢....

Hi all,

I need to do the client side validations for my empty asp.net MVC 3 app...

What i know till now is,

"We can write the validations in the form of functions in javascript file and then we can call this function and js file along with CSS in _Layout.cshtml file."

Now my question is while searching in google, i found as "Unobtrusive JavaScrip".

I am not getting clear idea regarding this.

Can any one tell me exactly what it mean and in which way we can use it....

Thanks in advance....

推荐答案

不引人注目的JavaScript是在网页中使用JavaScript的一种通用方法.
使用非侵入式验证时,验证规则将转换为HTML5属性. HTML5属性名称只能包含小写字母,数字和破折号.

看看:
http://nraykov.wordpress.com/2011 /06/06/asp-net-mvc-3-unobtrusive-client-side-validation/ [ http://bradwilson.typepad.com/blog/2010/10/mvc3-unobtrusive- validation.html [ ^ ]
Unobtrusive JavaScript is a general approach to the use of JavaScript in web pages.
When you use unobtrusive validation, the validation rules are turned into HTML5 attributes. HTML5 attribute names can consist of only lowercase letters, numbers, and dashes.

have a look at :
http://nraykov.wordpress.com/2011/06/06/asp-net-mvc-3-unobtrusive-client-side-validation/[^]
http://bradwilson.typepad.com/blog/2010/10/mvc3-unobtrusive-validation.html[^]


这篇关于什么是不干扰Javascript验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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