Skip to main content

MVCxClientBeginCallbackEventArgs.customArgs Property

Gets an object containing specific information (if any, as name/value pairs) that should be passed as a request parameter from the client to the server side for further processing.

#Declaration

TypeScript
customArgs: any

#Property Value

Type Description
any

A hash table object containing named values to be passed from the client to the server side via request parameters.

#Remarks

The customArgs property allows you to pass any required information collected on the client side to the server side, for further processing within a controller action. You can assign the customArgs property with a named value which is then passed as a request parameter. On the server side, it can be accessed within the Request.Params collection by the given name.

View:

function OnBeginCallback(s, e) {
            e.customArgs["Value1"] = 1;
            e.customArgs["Value2"] = 2;
        }  

Controller:

public ActionResult MyView() {
            int myValue1 = !string.IsNullOrEmpty(Request.Params["Value1"]) ? int.Parse(Request.Params["Value1"]) : 0;
            int myValue2 = !string.IsNullOrEmpty(Request.Params["Value2"]) ? int.Parse(Request.Params["Value2"]) : 0;
            ...
        }
See Also