Why is Ajax.ActionLink updating entire page instead of just UpdateTarget

后端 未结 3 1734
陌清茗
陌清茗 2021-02-20 11:21

This should replace just the UpdateTarget, but it does not, it replaces the entire page and I don\'t see why. The correct partial view is being returned, but instead of replaci

相关标签:
3条回答
  • 2021-02-20 12:04

    Adding below script file reference worked.

    <script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
    
    0 讨论(0)
  • 2021-02-20 12:11

    This happens because of this main reason that your jquery script file and jquery unobtrusive ajax are not included on the main layout or child view, i am afraid that you are missing them,include the jquery,jquery unobtrusive ajax files in view and it will work like a charm.

    0 讨论(0)
  • 2021-02-20 12:25

    Check if you are loading @Scripts.Render("~/bundles/jqueryval") into your page somewhere or not. It is probably because unobtrusive javascript file is not getting loaded. Check this video

    Edit:
    Please check if you there packages installed in your packages.config file.

    <package id="Microsoft.jQuery.Unobtrusive.Ajax" version="3.1.1" targetFramework="net451" />
      <package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.0.0" targetFramework="net451" />
    
    0 讨论(0)
提交回复
热议问题