Solved

asp.net ajax

Posted on 2014-02-24
7
255 Views
Last Modified: 2014-03-12
I have below codes and the ajaxfileUpload is not working. Why and how to fix?
Thanks

<asp:UpdatePanel runat="server" ID="updatePanel"> 
    <Triggers> </Triggers>
 <ContentTemplate>
 <asp:Wizard ID="Wizard1"  Width="1580px" runat="server" CssClass="box_a"  DisplaySideBar="False">
<asp:WizardStep ID="WizardStep1" runat="server" Title="Step 1">
 <asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" OnUploadComplete="FileUploadComplete" Width="1000px"/>      
 </asp:WizardStep>
 </asp:Wizard>
</ContentTemplate>
</asp:UpdatePanel>

Open in new window

0
Comment
Question by:CoolDev2014
  • 4
  • 3
7 Comments
 
LVL 18

Expert Comment

by:Jerry Miller
ID: 39883647
I've had to define triggers to make the ASP fileupload to work inside an updatepanel. It may be something similar with the Ajax version.

 <Triggers>
                <asp:PostBackTrigger ControlID="btnUpload"  />
                <asp:AsyncPostBackTrigger ControlID="btnProcessData" />
            </Triggers>

Here is a full code example:
http://www.codeproject.com/Articles/482800/FileplusUploadplusinplusUpdateplusPanel
0
 

Author Comment

by:CoolDev2014
ID: 39884750
btnUpload? I don't have that button in my codes.
0
 
LVL 18

Expert Comment

by:Jerry Miller
ID: 39885924
The UpdatePanel and FileUpload processes don't like to work together, so you have to make them work by using the triggers.

If you remove the UpdatePanel and your fileupload process works, you need to follow the example on the link that I supplied. It details how to define the Triggers section and set postbacks to work within the updatepanel.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:CoolDev2014
ID: 39890093
so there is no solution by using :AjaxFileUpload without a button?
0
 
LVL 18

Expert Comment

by:Jerry Miller
ID: 39890336
You can remove the UpdatePanel. You don't have anything in there that requires an asynchronous postback anyway.
0
 

Author Comment

by:CoolDev2014
ID: 39898801
My point is...I don't want to create another button for file upload because ajaxfileupload already have one.
0
 
LVL 18

Accepted Solution

by:
Jerry Miller earned 500 total points
ID: 39899029
If you leave it as is it doesn't work because the FileUpload control always thinks it is empty when placed inside an UpdatePanel.

If you remove the UpdatePanel, you can leave the FileUpload Control alone. Unless someone has found another way around this problem, your options are to remove the UpdatePanel or add triggers with extra buttons.

I have searched a lot on this subject and I normally use the triggers because I will have a label to display success or failure of the upload. But I do sometimes put the FileUpload outside of the UpdatePanel. It really depends on what is necessary in each situation.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now