views:

29

answers:

1

Hi folks, i've the following code:

   <asp:UpdatePanel runat="server" ID="upPanelFoto">
                    <ContentTemplate>

                        <asp:FileUpload onChange="CaricaFileImmagine();" ID="FileUpload1" runat="server" BorderStyle="Solid" />
                        &nbsp;<asp:Button ID="btnCaricaImmagine" runat="server" Text="Carica" CssClass="Pulsanti" />
                    </ContentTemplate>
                    <Triggers>
                        <asp:PostBackTrigger ControlID="btnCaricaImmagine" />
                    </Triggers>
                </asp:UpdatePanel>

In the same page i've some asp.net fieldvalidator (to validate other field). When i click "btnCaricaImmagine" that function never is called, and field validator appear on the screen...

How can i do to load my file ? Thanks

A: 

The validator will need to be within the update panel, as will whatever control it is validating.

However, there isn't much point putting a file upload in an update panel as it cause a full postback anyway (hence why you've used the postback trigger). Look at the AsyncFileUpload control or SWFUpload for async uploads.

David Neale
i'm trying also with AsyncFileUpload but it still don't work... mmmm
stighy
Did you put the `AsyncFileUpload` inside an UpdatePanel? It shouldn't be in one. It still won't fire your validator control's events though.
David Neale