Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
22
rated 0 times [  24] [ 2]  / answers: 1 / hits: 16278  / 9 Years ago, wed, july 29, 2015, 12:00:00

I am quite familiar with unobtrusive Javascript as a pattern, but I am curious what it means to the .NET framework.



I am working on a project as a front-end developer that uses .NET on the back end. While working with a developer (who also manages the server), he mentioned that UnobtrusiveJavaScript must be set to false for our project. That is, the project's web.config should have the following:



<appSettings>
...
<add key=UnobtrusiveJavaScriptEnabled value=false />
</appSettings>




My first reaction was that this was bad practice, but when I though about it further, I realized that I don't really understand why .NET would even have such a setting at the project level to begin with, or whether it even matters for our particular project.


More From » .net

 Answers
14

From here:




The purpose of that setting is explained by Brad Wilson in his post Unobtrusive Client Validation in ASP.NET MVC 3. Putting it short - with this setting turned off client side validation is being performed using Microsoft javascript libraries (the same way it was performed in ASP.NET MVC 1 and 2). Otherwise (with setting turned on) client side validation is performed using JQuery Validate.




So in other words, your application probably has code that depends on the Microsoft JavaScript libraries that perform validation.


[#65620] Tuesday, July 28, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sherryd

Total Points: 254
Total Questions: 92
Total Answers: 89

Location: Equatorial Guinea
Member since Sun, Feb 14, 2021
3 Years ago
;