문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top