tags:

views:

46

answers:

1

I am using ajax toolkit PopupControl Extender to display row details of a gridview. The gridview is inside an Update panel. inside the popup window, there is a FileUpload control inside another UpdatePanel. In the child UpdatePanel where the FileUplad control sits, I set the trigger to a linkbutton which will upload file and update the database. My problem is the FileUpload.HasFile is alway false. How can I get it work?

The markup code is as follows:

    <asp:GridView ID="gdvTemplates" runat="server" AutoGenerateColumns="False" BorderWidth="0" GridLines="None">
    <Columns>
            .

. .

      <cc1:PopupControlExtender ID="Image1_PopupControlExtender" runat="server" 
                        DynamicServicePath="" Enabled="True" ExtenderControlID="" 
                        TargetControlID="Image1" PopupControlID="Panel1">
     </cc1:PopupControlExtender>

    <asp:Panel ID="Panel1" style="display:none" runat="server" CssClass="popup_template" Width="383px">


  <asp:FileUpload ID="FileUpload2" runat="server" />
  </td><td></td></tr> 

 <tr><td class="style7"></td><td class="style3">     

oncommand="LinkButton2_Click">Update Cancel

Some code is omitted. The question is how to get the FileUpload control work inside the child UpdatePanel in the Popup window.

Thanks.

A: 

This is because there MUST be a full postback for file upload, a partial post back will fail. Use IFrames for this, there are lots of examples of this.

Marcus
I heard about using iFrame as a workaround. But my question is that I used the trigger for file upload successfully, but this time the difference is I have another UpdatePanel nested inside the parent UpdatePanel, why it did not work this time with nested UpdatePanel? It seems even trigger won't work and the iframe is the only soution? I do not want to use flash based method (I heard this as well).
Bob Yuan
One more thing I found with FileUpload control within UpdatePanel, even in the nested UpdatePanel, adding <Triggers><asp:PostBackTrigger ControlID="Linkbutton1"/></Triggers> works perfectly. The issue seems my FileUpload control is in a PopupControl Extender, anything special here with this popup window? Need more exploration. Please help if you can.
Bob Yuan
Hi, those few times ive struggle with the FileUploader my problems has been partial postbacks. Maybe theres an other problem with nested update panels that has noting to do with the postbacks. I don't have any answers for that.
Marcus

related questions