Beginning ASP.NET MVC 4 by Jose Guay Paz

Beginning ASP.NET MVC 4 by Jose Guay Paz

Author:Jose Guay Paz [Paz, Jose Guay]
Language: eng
Format: epub, pdf
Tags: Computers, Programming Languages, Programming, C#, Microsoft
ISBN: 9781430257523
Publisher: Apress
Published: 2013-06-26T04:00:00+00:00


return PartialView();

}

The GetPhoto partial view is as follows:

<img src="@ViewBag.Photo" style="width:150px;height:120px" />

Figure 8-6. Ajax link to load the pet photo

Implementing Ajax Callbacks

The AjaxOptions parameter also includes properties that define JavaScript functions to be called during the Ajax request life cycle. These are called event callback functions.

The Ajax request life cycle can be defined by the diagram in Figure 8-7. The life cycle is quite simple. When the request begins, the OnBegin callback function is executed. After the request completes but before the page is updated, the OnComplete callback function executes. At this point, if the request has completed successfully, the OnSuccess callback function is executed; otherwise, the OnFailure callback function is executed.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.