Are MicrosoftAjax.js, MicrosoftMvcAjax.js and MicrosoftMvcValidation.js obsolete as of ASP.NET MVC 3?

Asked
Active3 hr before
Viewed126 times

7 Answers

90%

Meta Stack Overflow , Stack Overflow help chat ,Stack Overflow en español,Stack Overflow на русском

2 new functionalities have been introduced

<appSettings>
   <add key="webpages:Version" value="1.0.0.0" />
   <add key="ClientValidationEnabled" value="true" />
   <add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
load more v
88%

So in ASp.NET MVC 3 you can forget about all Microsoft* scripts. Remove them from your site. Delete those files.,2 new functionalities have been introduced,Yes, all Microsoft* helpers are obsolete in ASP.NET MVC 3. For me they have always been obsolete but now at least Microsoft made this official and replaced them with jQuery. ,I have a following area in my application. So the below highlighted section is out concerned Controller. ok.

2 new functionalities have been introduced

<appSettings>
   <add key="webpages:Version" value="1.0.0.0" />
   <add key="ClientValidationEnabled" value="true" />
   <add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>

The second is ClientValidationEnabled which is also enabled by default. The same way unobtrusive javascript works, when you enable this setting all helpers that generate input fields will emit HTML5 data-* attributes on them. Then you include jquery.validate.js and jquery.validate.unobtrusive.js scripts to make them work, such as in your _Layout.cshtml. They must appear in this order, and they must be after jquery is loaded:

<script src="@Url.Content(" ~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content(" ~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content(" ~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
load more v
72%

asp.net mvc - Mi crosoftMvcValidation.js VS jquery.validate.js (Bassistance) , javascript - No, MicrosoftAjax.js and MicrosoftMvcAjax.js Of ASP.NET MVC ,Are MicrosoftAjax.js, MicrosoftMvcAjax.js and MicrosoftMvcValidation.js obsolete as of ASP.NET MVC 3? I haven't been able to find much info on this on the web, but from what I've read it implies that these files were used in ASP.NET MVC 1-2, and were replaced by jquery.validate.min.js, jquery.unobtrusive-ajax.min.js and jquery.validate.unobtrusive.min.js. Is that correct? Do I still need the Microsoft files?

Are MicrosoftAjax.js, MicrosoftMvcAjax.js and MicrosoftMvcValidation.js obsolete as of ASP.NET MVC 3? I haven't been able to find much info on this on the web, but from what I've read it implies that these files were used in ASP.NET MVC 1-2, and were replaced by jquery.validate.min.js, jquery.unobtrusive-ajax.min.js and jquery.validate.unobtrusive.min.js. Is that correct? Do I still need the Microsoft files?

MicrosoftAjax.js
load more v
65%

Są MicrosoftAjax.js, MicrosoftMvcAjax.js i MicrosoftMvcValidation.js przestarzałe od ASP.NET MVC 3? Nie byłem w stanie znaleźć wiele informacji na ten temat w Internecie, ale z tego, co czytałem, sugeruje to, że te pliki były używane w ASP.NET MVC 1-2 I zostały zastąpione przez jquery.validate.min.js, jquery.unobtrusive-ajax.min.js i jquery.validate.unobtrusive.min.js. Zgadza się? Czy nadal potrzebuję plików Microsoft?,Tak, wszystkie Microsoft* helpery są przestarzałe w ASP.NET MVC 3. Dla mnie zawsze były przestarzałe, ale teraz przynajmniej Microsoft zrobił to oficjalnie i zastąpił je jQuery. ,Więc w ASp.NET MVC 3 możesz zapomnieć o wszystkich Microsoft* skryptach. Usuń je ze swojej witryny. Usuń te pliki.

2 nowe funkcjonalności zostały wprowadzone

<appSettings>
   <add key="webpages:Version" value="1.0.0.0" />
   <add key="ClientValidationEnabled" value="true" />
   <add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
load more v
75%

本文地址:IT屋 » 是MicrosoftAjax.js,MicrosoftMvcAjax.js和MicrosoftMvcValidation.js过时ASP.NET MVC 3?,So in ASp.NET MVC 3 you can forget about all Microsoft* scripts. Remove them from your site. Delete those files.

2的新功能已经引入

LT;
 的appSettings& GT;&
 LT;
 添加键 = "网页:版本"
 值 = "1.0.0.0" / &GT;&
 LT;
 添加键 = "ClientValidationEnabled"
 值 = "真" / &GT;&
 LT;
 添加键 = "UnobtrusiveJavaScriptEnabled"
 值 = "真" / &GT;&
 LT;
 /的appSettings&GT;

二是 ClientValidationEnabled 这也是默认启用的。他们的JavaScript的作品,当您启用此设置的所有产生输入字段助手会发出HTML5数据 - *用同样的方法不显眼的属性。然后,你包括 jquery.validate.js 和 jquery.validate.unobtrusive.js 脚本,以使他们的工作,如在_Layout.cshtml。 他们必须按以下顺序出现,它们必须被加载后jQuery的:

LT;
 脚本SRC = "@ Url.Content("〜 / 脚本 / jQuery的 - 1.7 .1.min.js ")"
 类型 = "文/ JavaScript的"GT;&
 LT;
 / SCRIPTGT;&
 LT;
 脚本SRC = "@ Url.Content("〜 / 脚本 / jquery.validate.min.js ")"
 类型 = "文/ JavaScript的"GT;&
 LT;
 / SCRIPTGT;&
 LT;
 脚本SRC = "@ Url.Content("〜 / 脚本 / jquery.validate.unobtrusive.min.js ")"
 类型 = "文/ JavaScript的"GT;&
 LT;
 / SCRIPTGT;
load more v
40%

因此,在ASp.NET MVC 3中,您可以忘记所有Microsoft*脚本。 从您的网站中删除它们。 删除那些文件。,是的,所有Microsoft*帮助程序在ASP.NET MVC 3中都是过时的。对我来说,它们一直都过时了,但是现在至少Microsoft将此正式发布,并用jQuery代替。

引入了2个新功能

<appSettings>
   <add key="webpages:Version" value="1.0.0.0" />
   <add key="ClientValidationEnabled" value="true" />
   <add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
load more v
22%

Are MicrosoftAjax.js, MicrosoftMvcAjax.js and MicrosoftMvcValidation.js deprecated as ASP.NET MVC 3?,I realized this after reading @Darin Dimitrov to answer the following question:,Thanks a lot to Darin. The answer is worth reading in order to enlighten yourself about the significance of the two applications that I disabled.,And he needed to drop the microsoft * .js files, that is:

Code in view:

@ {
   using(Ajax.BeginForm(Model.Step.ActionName, null, new AjaxOptions {
         UpdateTargetId = "wizardStep", OnBegin = "isValid", LoadingElementId = "PleaseWait", OnSuccess = "SetFocusOnForm"
      }, new {
         @name = "wizardForm", @id = "wizardForm"
      })) { //form contents } } 

MVC 3:

 <form action="/Solicitors/Company/New/YourDetails" id="wizardForm" method="post" name="wizardForm" onclick="Sys.Mvc.AsyncForm.handleClick(this, new Sys.UI.DomEvent(event));" onsubmit="Sys.Mvc.AsyncForm.handleSubmit(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, loadingElementId: 'PleaseWait', updateTargetId: 'wizardStep', onBegin: Function.createDelegate(this, isValid), onSuccess: Function.createDelegate(this, SetFocusOnForm) });"> // form contents </form> 

MVC 4:

 <form action="/Solicitors/Company/New/LoginDetails" data-ajax="true" data-ajax-begin="isValid" data-ajax-loading="#PleaseWait" data-ajax-mode="replace" data-ajax-success="SetFocusOnForm" data-ajax-update="#wizardStep" id="wizardForm" method="post" name="wizardForm" novalidate="novalidate"> // form contents </form>
load more v

Other "undefined-undefined" queries related to "Are MicrosoftAjax.js, MicrosoftMvcAjax.js and MicrosoftMvcValidation.js obsolete as of ASP.NET MVC 3?"