简体   繁体   中英

Using Html.RenderAction and Ajax.ActionLink together

when i do this, i get the ACTION being called TWICE, what should i do about this?

if i call html.partial instead to just render the control, then i need to specify all the objects/values manually, which i shouldn't need to do this as the ACTION itself takes care of this stuff.

i maeks sense to have both these work together but they don't, what should i do?

An Ajax.ActionLink is used to asynchronously update an area of a page with the result of a controller action when the link is clicked. Html.RenderAction renders the result of a controller action during the initial rendering of the page.

If you had your Html.RenderAction calling the same action as your Ajax.ActionLink, and the Ajax.RenderAction was inside the target div of the Ajax.RenderAction, then the action would be called twice whenever the Ajax.RenderAction was invoked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM