ASP.NET FileUpload : not work if there's validator?
i've the following code:
<asp:UpdatePanel runat="server" ID="upPanelFoto">
<ContentTemplate>
<asp:FileUpload onChange="CaricaFileImmagine();" ID="FileUpload1" runat="server" BorderStyle="Solid" />
<asp:Button ID="btnCa开发者_高级运维ricaImmagine" 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
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.
精彩评论