Microsoft JScript运行时错误:'Sys'未定义(在mvc3 c#razor中)

时间:2012-08-29 06:51:57

标签: c# javascript jquery asp.net-mvc-3 razor

在cshtml中

<form action="/Sp/EditSp" method="post" 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, httpMethod: &#39;POST&#39;, updateTargetId: &#39;divDisplay&#39;, onSuccess: Function.createDelegate(this, deactivateAList) });"><input type="hidden" id="requestSequence" name="requestSequence" value="24" />

的javascript:

`

<script type="text/javascript">
function deactivateAList() {
    document.getElementById("AList").style.display = "none";
}
</script>

`

请告诉我如何解决此错误。

1 个答案:

答案 0 :(得分:5)

我已添加:

<add key="UnobtrusiveJavaScriptEnabled" value="true" />

Web.Config

中的