.NET Framework Class Library
AjaxOptions..::.OnSuccess Property

Gets or sets the JavaScript function to call after the page is successfully updated.

Namespace:  System.Web.Mvc.Ajax
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)
Syntax

Visual Basic (Declaration)
Public Property OnSuccess As String
    Get
    Set
Visual Basic (Usage)
Dim instance As AjaxOptions
Dim value As String

value = instance.OnSuccess

instance.OnSuccess = value
C#
public string OnSuccess { get; set; }
Visual C++
public:
property String^ OnSuccess {
    String^ get ();
    void set (String^ value);
}

Property Value

Type: System..::.String
The JavaScript function to call after the page is successfully updated.
Remarks

This function is called if the response status is in the 200 range.

See Also

Reference

Tags :


Community Content

Joel Martinez
Does the OnSuccess callback have arguments?
This doesn't say whether the callback will return any arguments to the callback ... specifically, does it return a json object that may be returned from the action method?
Tags : asp.netmvc

Neil Moss
OnSuccess function signature

The method signature is:

function myOnSuccessEventHandler(ajaxContext)
{
...
}

ajaxContext provides:

get_data() method to get the response from the server.
_response property to get further details of the response.

plus others.

_response appears to be an instance of Sys.Net.XMLHttpExecutor - see http://msdn.microsoft.com/en-us/library/bb397459.aspx

e.g.

ajaxContext._response.get_statusCode() to get the http status code value of the response.

ajaxContext._response.getResponseHeader(headerName) to get the value of an http response header, e.g. "Content-Type"

Tags : ajax mvc

Page view tracker