Question

I have an .aspx page with a WebDataTree control, a WebHierarchicalDataSource control (configured with 2 SqlDataSource controls), and a WebUpload control.

It's a simple setup, user uploads a file, which executes some code-behind that updates the database, which should then refresh the WebDataTree. The tree is indeed initially populated with existing data. And Uploading new files should refresh that list.

The database does get updated with new file information, and If I force a page refresh the tree does get repopulated. But I'd like the WebDataTree to repopulate once a file is uploaded, which I normally do by calling the control's DataBind() on post back, in this case WedDataTree1.DataBind() during the WebUpload1_UploadFinished() event.

But this does not refresh the WebDataTree control. Am I missing something? Is this not the way to refresh the control?

Was it helpful?

Solution

The UploadFinished even isn't a request for the page so there is no page sent back to the client. You should handle the client side fileUploaded event and trigger the refresh of the WebDataTree from the client. For this you would need to trigger a post back from code and rebind the tree on the server. If you wanted to avoid doing a post back manually you could look into using the Ignite UI tree and make a call to the server just to get the updated data.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top