flag_en.png English version - flag_fr.png Version française

Project Description

DynAjax is a Javascript / Ajax / ASP.Net / C# Framework easing dynamic calls to server methods directly from JavaScript code.
The object serialization is based on JSON, permitting complex objects exchange.
dynAjax_schema.png

Download latest release (v1.06)

DynAjax v1.06 - delivered the 23 oct. 2008

What is DynAjax ?

DynAjax is a development framework based on C# .Net / ASP .Net on server side and Prototype on client side (Javascript useful library) that permits direct call of server side C# methods from client side Javascript.

Who is DynAjax for ?

Every C# / ASP .Net developpers who want to add efficient and easy to use Ajax to their web applications and professional developments (I created it for my own professional needs / use).

Who uses DynAjax ?

DynAjax is used by several companies like SGCIB, e-TimeTracker, Alauzis etc.

What can DynAjax do ?

Imagine you're developping a professional web application and you need to save a text typed by user into the database without posting HTML Form and reloading the entire page. Obviously, you'll use the Ajax technology for that.
What about defining entire XmlHttpRequest (Ajax) request and check the response codes etc. to send data and be sure it has been saved correctly ? it's boring.
With DynAjax, you can save this text via the following JavaScript code (suppose you get a public method called 'saveText' into your class 'MyClass' that returns the string "ok" if everything was fine) :
var response = MyClass.saveText(myText);
if (response == "ok") {
    --- code here ---
}

Very simple to use, isn't it ?
Visit Samples page to get a lot of sources / samples.

Is DynAjax synchronous or asynchronous ?

It's up to you: if you want DynAjax to be synchronous, use the following code:
var response = MyClass.myMethod(myArgs);
if (response >= 2) {
    --- code here ---
}

Now you want an asynchronous call, just use the second syntax:
MyClass.myMethod(myArgs, function(response) {
        if (response >= 2) {
            --- code here ---
        }
    });

DynAjax recognizes automatically the way you want it to be used.

What kind of data can be returned by DynAjax to client JavaScript ?

Data of almost any type can be returned by server. Actually, data are transmitted in JSON format (an exchange format between JavaScript and other languages, including C# .Net).
This format permits the following data types:
  • Strings
  • Numbers (int, decimal...)
  • Booleans
  • Arrays
  • HashTables
  • Complex objects (made of Properties, Arrays, HashTables, Arrays of other complex objects etc.)
  • "null" value

As you can see, almost everything is possible: you can, for example, if you need to develop a site like eBay, call a method that return a list of Product instances to display on user search - you just have to iterate on list and have access to all Product instances properties as you were in C# code.
Please visit Json description site if you want further informations about this format.

What about security ?

DynAjax provides security checks on all methods you can call remotely.
Actually, each method has to be defined into an XML configuration file and you can specify wether it needs - or not - authentication on your application.
Thus, hackers aren't able to call remote methods without granted access.

Is it difficult to install / set up DynAjax into my web application ?

No, DynAjax is based on 8 files :
  • DynAjaxHandler.aspx and DynAjaxHandler.cs - the Ajax handler that will receive and dispatch all DynAjax calls
  • dynAjaxScript.aspx and dynAjaxScript.cs - the dynamix JavaScript part of DynAjax (it's JavaScript, though its extension is .aspx)
  • prototype.js - the prototype framework
  • Newtonsoft.Json.dll - a Json library for .Net
  • log4net.dll - logging library
  • dynAjaxConfig.xml - the DynAjax configuration file (in XML format)

These 8 files must be copied into your web application directory, and only the dynAjaxConfig.xml needs to be updated to suit your needs.
Pretty easy, no ?
Take a look at the first tutorial DynAjax tutorial 01 to get step by step DynAjax configuration.

How do I configure my methods definition ?

You can visit this Wiki page: configuration, everything's explained.

Features list summary

Server methods remoting call
Server exceptions trapping and custom treatment definitionon client side
Synchronous or asynchronous methods call
Complex data exchange (JSON based)
Security support
Listing of server methods (on debug mode) in HTML page (very useful on web app administration)

Who supports this framework ?

Me (Mr Benoît BEGUIN) and my company Odesys. Feel free to contact us at admin@dynajax.org to get informations, report bugs or suggest new features.

Last edited Jan 18, 2009 at 1:06 PM by magicben, version 24