UpdatePanel Postback - How to make it work ?

J

Jl_G_0

I have a form with ALL my controls on an updatepanel, but theres one
giving me a hard time, its an asp:FileUpload control.
All I want to do is:
- Click on a LinkButton <- WORKS
- Open a ModalPopUpExtender with the FileUpload <- WORKS
- Select the file and click on another LinkButton to close the
ModalPopUp <- WORKS
- Click on SEND and send the file. <- ERROR HERE

I can make it work perfectly without the UpdatePanel, or if I set the
UpdatePanel to PostBack when I Click on SEND.
However I want it to work with no postbacks, but seems like its not
possible.
I guess the problem is when the UpdatePanel does its AsyncPostBack,
it sets the FileUpload.PostedFile.Filename to NULL, and causes an
error (object reference...).

Any ideas ?

Thx.
 
B

bruce barker

the update panel does not support fileupload.

the update panel uses ajax to send the value of controls to the server,
the server then produces the html and sends it back. the update panel
then display the html.

the fileupload uses the browser to do a mutipart mime type to send the
filedata. browser security prevents javascript setting the name.

you could host an iframe with a fileupload that posted back.

-- bruce (sqlwork.com)
 
J

Jl_G_0

thanks for answering me.

well, I guess I can try the Iframe then... everything to avoid the
postback...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top