Hello,
I'm using webdatatree for navigation between frames. On click on the server side I form the navigate URL. Then in AJAXResponse handler I want to navigate to that URL using frames location. Where would you recommend to store the path, so that I can obtain it already in AJAXResponse handler? Perhaps some extra ajax control? I tried storing it in one of WebDataTree nodes, in its Target property just to be logical. But when I obtain it on the client side, it holds the old value.
I tried this.WebDataTree1.CustomAJAXResponse.Tag = "myURL";
and then var path = e.get_customResponseObject().Tag; in WebDataTree1_AJAXResponse.
It susccessfully retrieves the pathstring, but then throws the following JS error:
Microsoft JScript runtime error: Unable to get value of the property 'setAttribute': object is null or undefined
in the second line of
buildNodeLiId: function(nodeElem, adr) { var id = "x:1.1:adr:" + adr; nodeElem.setAttribute("id", id); nodeElem.setAttribute("adr", adr); }.
If in server side i comment this.WebDataTree1.CustomAJAXResponse.Tag = "myURL"; and use fixed URL, it works ok.
The same is if I use not Tag, but Message
Any help?
Here is even the sample solution.
Hello Andrey,
I would suggest you to use the AdditionalProperties property of the CustomAJAXResponse. You can add a object in code-behind and get its value in AJAXResponse client-side event like this:
this.WebDataTree1.CustomAJAXResponse.AdditionalProperties.Add("key1", "SomeURL");
function WebDataTree1_AJAXResponse(sender, e){ var url1 = e.get_customResponseObject().AdditionalProperties.key1;}
Let me know if this helps.