Sending the data to the server-side events
All the events use the AJAXPage control to post data to the server
(without reloading the page) and return the result to the client.
A set of parameters is being sent for each event. To change the name
or these parameters or to use the result returned from the server
you have to open the
ob_events_xxxx.js file and edit the
events you need.
For example, the
ob_OnNodeEdit function, which is executed every time
a node is edited:
function ob_OnNodeEdit(id, text, prevText)
{
// add client side code here
//alert("OnNodeEdit on " + id + "\n text: " + text + "\n prevText: " + prevText);
if(ob_ev("OnNodeEdit"))
{
if(typeof ob_post != "undefined")
{
ob_post.AddParam("id", id);
ob_post.AddParam("text", text);
ob_post.AddParam("prevText", prevText);
//Change "TreeEvents.aspx" with the name of your server-side processing file
var sResult = ob_post.post("TreeEvents.aspx", "OnNodeEdit");
//use the result returned from the server:
alert(sResult);
}
else
{
alert("You have to add the AJAXPage control to your page in order to use the server-side events!");
}
}
}
There are 3 parameters that will be sent to the server:
id, text and
prevText
You can use the result returned from the server into your client-side functions.