Solved

asp.net ajax

Posted on 2014-02-24
7
264 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 

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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

724 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