Ajax.actionlink Auxiliary method for local refresh

Source: Internet
Author: User
Tags actionlink

1, need to reference a JS file jquery.unobtrusive-ajax.js "MVC4 Default exists Scripts folder" reference to the master page
_layout.cshtml, and be sure to place it after the jquery reference file
2, you need to add a distribution view to the specified directory, the distribution view is used to display the local refresh
3, the controller needs to add a point to the distribution view of the action, return must call Partialview point to the distribution view "return Partialview" ("_ajax", model ...); ": _ajax is the view file name that points to the distribution view.
4,<div id= "ajax_id" >
@Ajax. ActionLink ("Click here for local refresh", "Brush", "Test", New ajaxoptions
{
Updatetargetid = "ajax_id",//This ID is identical to the ID of the outer Div, the content of the local refresh will be displayed in this div
Insertionmode = Insertionmode.replace,
HttpMethod = "GET"
})
</div>

Ajax.actionlink Auxiliary method for local refresh

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.