相关疑难解决方法(0)

为什么UnobtrusiveJavaScriptEnabled = true禁用我的ajax工作?

我正在使用MVC3剃刀做一个样本,并写道:

<p>
    Show me the time in:
    @Ajax.ActionLink("UTC", "GetTime", new { zone = "utc" }, new AjaxOptions { UpdateTargetId = "myResults" })
    @Ajax.ActionLink("BST", "GetTime", new { zone = "bst" }, new AjaxOptions { UpdateTargetId = "myResults" })
    @Ajax.ActionLink("MDT", "GetTime", new { zone = "mdt" }, new AjaxOptions { UpdateTargetId = "myResults" })
</p>
<div id="myResults" style="border: 2px dotted red; padding: .5em;">
    Results will appear here
</div>
<p>
    This page was generated at @DateTime.UtcNow.ToString("h:MM:ss tt") (UTC)
</p>
Run Code Online (Sandbox Code Playgroud)

在web.config中更改此密钥之前,我的所有ajax调用都不起作用:

<add key="UnobtrusiveJavaScriptEnabled" value="true"/> …
Run Code Online (Sandbox Code Playgroud)

ajax asp.net-mvc asp.net-mvc-ajax razor asp.net-mvc-3

32
推荐指数
1
解决办法
3万
查看次数