MVC (3) handleUpdate

I am living through this tutorial on codeplex , which is a MusicStore application.

In Senario, he adds music to a shopping cart. Then it also allows users to delete it. In my opinion, it does this through the Ajax postback, which is implemented in the controller.

What puzzles me is that there are links to a JavaScript function called "handleUpdate ()" that is declared on the same page. It seems that it updates the shopping basket after, for example, an item has been removed from the basket. I don’t see anyone calling him from anywhere. Can someone explain how and when it is called?

+5
source share
2 answers

, . , .

http://www.asp.net/mvc/tutorials/mvc-music-store-part-8:

... Html.ActionLink , Ajax.ActionLink:

@Ajax.ActionLink("Remove from cart", "RemoveFromCart", 
new { id = item.RecordId }, new AjaxOptions { OnSuccess = "handleUpdate" })

html.ActionLink, AJAX RemoveFromCart. FromCart JSON, JavaScript, AjaxOptions OnSuccess - handleUpdate . handleUpdate Javascript JSON , JQuery:

  • .
+4

All Articles