开发者

Ajax.ActionLink generated markup lacks onclick attribute

I've got problem with generating ajax anchors. I'm using simple Ajax.ActionLink("test", "Test", new AjaxOptions { UpdateTargetId="test", HttpMethod="GET" }) and开发者_如何学编程 the generated markup is: <a data-ajax="true" data-ajax-method="GET" data-ajax-mode="replace" data-ajax-update="#test" href="/Home/Test">test</a> which, obviously lacks the onclick="Sys.Mvc.AsyncHyperlink.handleClick(...)" attribute.

Anyone faced similar problem?


That's because you use unobtrusive javascript, which does not require the onclick handler.

Unobtrusive javascript is enabled by default in asp.net mvc 3.

The link should work though.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜