Hi Fabian,
In the client side, you need to stringify the selected node and send it to server side. In the server, you can deserialize the JSON string to dictionary object and process it further in the server side. Please refer to the code example below and sample below.
Code example:
//define the click event
Diagram1.Model.Click = "click";
function click(args) {
if (args && args.element) {
//get the selected node
var node = { nodes: args.element };
//JSON stringify the node
var stringvalue = JSON.stringify(node);
PageMethods.NodeClick(stringvalue, OnSuccess, OnError);
}
}
[WebMethod]
public static string NodeClick(string stringvalue)
{
Dictionary<string, object> requestArgs = (Dictionary<string, object>)new JavaScriptSerializer().DeserializeObject(stringvalue);
//to get the selected node
Dictionary<string,object> nodes = (Dictionary<string,object>)requestArgs["nodes"];
return null;
}
Regards,
Shyam G