Solved

asp.net ajax

Posted on 2014-02-24
7
254 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

10 Experts available now in Live!

Get 1:1 Help Now