ASP.NET MVC 3 (Razor) Ajax.ActionLink - What am i doing wrong?

后端 未结 3 2002
栀梦
栀梦 2021-02-03 18:39

Trying to have a AJAX action link which when clicked, should do a HttpGet to an action method which returns a PartialViewResult and shoves the HTML int

相关标签:
3条回答
  • 2021-02-03 18:44

    You may also want to include the InsertionMode option in the AjaxOptions. I'm sure there's a default behavior if you exclude it but it's better to explicitly define it for things like this.

    0 讨论(0)
  • 2021-02-03 18:53

    Make sure you have the unobtrusive AJAX javascript library included in your page.

    <script src="<%=Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")%>" type="text/javascript"></script>
    
    0 讨论(0)
  • And for those using the Razor view engine...

    <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
    
    0 讨论(0)
提交回复
热议问题