I have a web data tree that I want to use to control the contents of a WebImageViewer. I have the NodeClick event set to Async and in that event I am resetting the DataSource of the web image viewer, but nothing is happening:
image1.DataSource = data
;
image1.DataBind();
I wonder if it's because of the async nature of the postback. Does anyone know how to make this work? If I can't get it to work I'll move the WebImageViewer into an iframe and set the contents from Javascript using querystring params that give the tree node value - that's worked for me before.
Thanks.
Thanks. For the current situation I went ahead and did the JavaScript/iframe thing, which worked great, but this type of scenario comes up a lot for me so I will try UpdatePantel and Update() next time.
Hello,
Indeed you are observing this behaviour due the Async postback caused by WebDataTree. Eventhough you are changing data source of WebImageViewer, nothing is happening to it, since it did not initiated an async postback.
What I can suggest here to experiment with, is putting WebImageViewer inside a ContentTemplate of an UpdatePanel. Then, on the Async postback of NodeClick handler on the server, after binding the WebImageViewer to the new data source, call Update() method of the UpdatePanel. This should work.
Hope this helps