views:

400

answers:

2

I have a little problem with the FileUpload and uploadpanels.

As most of you probably knows you cannot use the asp:FileUpload control without forcing a postback. At least not what I know of, let me know if I am wrong.

Now my problem is: I have a usercontrol with a FileUpload and a button that says "Upload". This UserControl is loaded into a UpdatePanel. Now I want to register to the upload button inside the usercontrol as a postback trigger. Is there any way to do this?

Does anyone know of a way to make fileuploads without postbacks?

Best Regards The real napster

A: 

You need to add a trigger to your UpdatePanel control to force the button that submits the page to perform a full postback. An example would be:

<triggers>
        <asp:postbacktrigger controlid="btnSave" />
</triggers>
pmarflee
Yes I understand that but the btnSave is inside the UserControl and I dont want the rest of the buttons in the UserControl to perform a postback. I cannot add btnSave as a trigger as it is not there runtime.
The real napster
+1  A: 

Solved this issue

If anyone meets this challenge it can be solved by doing this in your UserControl

ScriptManager sman = ScriptManager.GetCurrent(Page);
sman.RegisterPostBackControl(btn_addDocument);
The real napster
Does your Update Progress work with this? Mine doesn't.
Blankasaurus