Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using ajax ModalPopupExtender to allow users to enter data. Along with data, users are required to upload file size 512. Control in form are input type text, asp:button and asp:FileUpload.Every control are working fine. My problem is on click on button for file upload, fileUpload.HasFile always shows false even when file is attached. I have attached code here.
XML
<div style="width: 180px; float: right;">
                                        <asp:FileUpload ID="fileUpload" runat="server" />
                                        &nbsp;&nbsp;

                                        <asp:Button id="btnUpload" runat="server" Text="Upload" OnClick="btnUpload_Click"  CssClass="button"/>
                                    </div>

<pre lang="cs">protected void btnUpload_Click(object sender, EventArgs e)
        {
            if (fileUpload.HasFile)
            {
            }
        }</pre>


I do not have idea of what's going on, Every time i click on Upload after selecting file, fileUpload.HasFile is always returning false. However, if i place this code outside modalpopupextender, fileupload is returning value true on file upload. Any help??
Posted
Comments
F-ES Sitecore 4-Aug-15 12:37pm    
I just googled "modalpopupextender fileupload" and got hundreds of relevant results. Have you gone through these yet to see if they help?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900