tags:

views:

24

answers:

1

Hi.

In my web application, one of my web pages contains an update panel in which I have a text box, a file upload control and a button. When the user selects a file using the file upload control and then clicks the button I am not getting any file from the file upload control. When I place a break point, the file upload control's showing a null value. Can you help me?

+2  A: 

It's OK to have the upload control itself inside the UpdatePanel; however, the button you click to start the upload must cause a full postback.

To do this, you could either move the button outside the UpdatePanel, or use <Triggers> to force your button to cause a postback:

<UpdatePanel runat="server">
    <ContentTemplate>
        ...
        <asp:Button runat="server" ID="myButton" />
        ...
    </ContentTemplate>
    <Triggers>
        <asp:PostBackTrigger ControlID="myButton" /> 
    </Triggers>
</UpdatePanel>
teedyay