2

Using ASP .NET MVC 4.5, jQuery 1.8.3 and Microsoft jQuery Unobtrusive Ajax v 2.0.30116.0.

I have the following code in a partial view:

 @Ajax.ActionLink("Delete", "DeletePost", new AjaxOptions { UpdateTargetId = "post" + post.Id, InsertionMode = InsertionMode.Replace, HttpMethod = "POST" })

I see the following the page source:

<script src="/Scripts/jquery-1.8.3.js"></script>
<script src="/Scripts/jquery.unobtrusive-ajax.js"></script>
<script src="/Scripts/jquery.validate.js"></script>
<script src="/Scripts/jquery.validate.unobtrusive.js"></script>

I have the following in the web.config

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

Clicking the "Delete" link navigates to the action url specified for the ActionLink:

http://localhost/Communities/DeletePost#

instead of leaving me on the page and making the AJAX request.

What's going on here?

4

0 回答 0