开发者

How to tell if the MicrosoftAjax javascript library is not being used?

开发者 https://www.devze.com 2023-04-12 23:55 出处:网络
I\'ve got the following scripts in an MVC3 application, but I\'m thinking that they aren\'t being used, just referenced. Is there an easy way to tell if they are being used somewhere within the markup

I've got the following scripts in an MVC3 application, but I'm thinking that they aren't being used, just referenced. Is there an easy way to tell if they are being used somewhere within the markup?

<script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script>  
<script src="/Scripts/MicrosoftMvcAjax.js" type="tex开发者_如何学Got/javascript"></script>
<script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>


From "Pro ASP.NET MVC 3 Framework, Third Edition"

There are also a set of files in the '~/Scripts' folder whose names start with Microsoft, for example MicrosoftAjax.js

These are from version 2 of the MVC framework and predate Microsoft fully embracing jQuery in ASP.NET MVC. We don't discuss these files since they have been superseded and are included in MVC framework just for compatibillity with earlier versions.

Since the book was written by Adam Freeman & Steven Sanderson (and the later works for Microsoft) then I think that's good enough for me ;)


The easiest way to tell that they are not being used is to remove all references to them, then thoroughly test all client-side functionality.

Most likely... unless your app was upgraded from MVC2 or someone added some code using the MS scripts noted, they are not needed for your MVC3 site.


The scripts that you have listed are required for a backward compatibility with MVC 2 applications.

As your question is regarding MVC 3 application, removing these scripts will have no effect on your application.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号