Jaxcent for .NET

Interacting with JavaScript

Executing JavaScript on the page

To execute JavaScript code from a Jaxcent page, call the JaxcentPage.ExecJavaScriptCode or JaxcentPage.EvalJavaScriptCode. The parameter of these methods is a valid JavaScript code string. The difference between between these is that ExecJavaScriptCode does not wait for the completion of the JavaScript call, whereas EvalJavaScriptCode does wait for completion, and returns the result of the execution.

Adding JavaScript verifiers

To add JavaScript verifiers that should be called before an event is sent to the server, call AddJavaScriptVerification on the element which you want verified.

Receiving callbacks

To receive callbacks from JavaScript code, have the JavaScript code call the function JaxcentServerRequest with one or more parameters, and add a handler for OnClientRequestReceived in JaxcentPage.

JavaScript objects

For advanced JavaScript integration, sometimes it may be required to send a JavaScript object that is not a simple string or integer or boolean etc, to the server and to have the server send it back. For this purpose, Jaxcent provides the following functions in JavaScript Note: The three functions above are not normally required in typical third party integration, which can be done simply via callbacks. Only advanced JavaScript code works with such objects, requiring the use of these functions.