开发者

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" />
                        &nbsp;<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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜