UpdatePanel Postback - How to make it work ?

Discussion in 'ASP .Net' started by Jl_G_0, Mar 29, 2007.

  1. Jl_G_0

    Jl_G_0 Guest

    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.
    Jl_G_0, Mar 29, 2007
    #1
    1. Advertising

  2. Jl_G_0

    bruce barker Guest

    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)




    Jl_G_0 wrote:
    > 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.
    >
    bruce barker, Mar 29, 2007
    #2
    1. Advertising

  3. Jl_G_0

    Jl_G_0 Guest

    thanks for answering me.

    well, I guess I can try the Iframe then... everything to avoid the
    postback...
    Jl_G_0, Mar 30, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. marss

    UpdatePanel, Postback

    marss, Jan 25, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    672
    marss
    Jan 25, 2007
  2. jobo
    Replies:
    1
    Views:
    604
    bruce barker
    Mar 7, 2007
  3. Veerle
    Replies:
    1
    Views:
    13,074
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
    Mar 15, 2007
  4. Replies:
    3
    Views:
    479
    Rob Meade
    Aug 8, 2007
  5. Nathan Sokalski
    Replies:
    1
    Views:
    588
    miher
    Jun 15, 2009
Loading...

Share This Page