Hi Jin-Yu Yin,
You are right, my problem came from the IFRAME. As the uploader was in an iframe, i coudn't update the main window automatically.
The FileuploaderAJAX found on the website (http://en.fileuploadajax.subgurim.net/) has the hability to perform custom javascript actions on demand. That was the solution !
So, my solution is : doing a normal upload with this control and then, once uploaded, doing the refresh of the updatepanel with javascript (with a hidden LinkButton).
In detail :
Add the custom JS event to the uploader in the Page_Load:
if (!Page.IsPostBack)
{
FileUploaderAJAX1.addCustomJS(FileUploaderAJAX.customJSevent.postUpload, "parent.RefreshPanel();");
}
Add the hidden linkbutton with javascript refresher on the page:
<asp:LinkButton ID="FakeRefreshButton" runat="server" OnClick="FakeRefreshButton_Click"
Style="display: none">LinkButton</asp:LinkButton>
<script type="text/javascript">
function RefreshPanel()
{
__doPostBack("FakeRefreshButton", "");
}
</script>Mark that button as a trigger for the updatepanel :
<Triggers>
<asp:AsyncPostBackTrigger ControlID="FakeRefreshButton" EventName="Click" />
</Triggers>
And finally add the code-behind code to handle the click event :
protected void FakeRefreshButton_Click(object sender, EventArgs e)
{
PopulateImageFolder();
//Reset fileuploader
FileUploaderAJAX1.Reset();
} HTH