I have used file upload control in Modal Pop Up Extender.I have used Update Panel for file Upload control to avoid Postback when i upload the Image.But My Page get Postbacks even i keep the update Panel.Here is my code:
Thanks for u r rply.I have already seen the above url u mentioned above.In the First URL,if u give AsyncPostBackTrigger it wont get the FileName.Iam having the same Problem.If i give PostbackTrigger,the Page is refreshed.Can u pls tell
me any solution in AsyncPostBackTrigger to get the Filename?
No.In our Project Uniformly they are using Update Panel Only.
AFAIK, the default asp.net file uploader needs a full postback in order to upload the file in to the server. An Asynchronous call would not take the file with it. Either you need to use the file uploader inside an iframe or you will have to do a complete
postback. If you need to keep your page while uploading the file, then simply place the fileuploader inside an iframe and do the uploading from there. Then the main page will remain same while it uploads the file inside the iframe.
smanjula
Member
205 Points
349 Posts
Update Panel in file Upload Control
Jan 23, 2013 11:19 AM|LINK
Hai,
I have used file upload control in Modal Pop Up Extender.I have used Update Panel for file Upload control to avoid Postback when i upload the Image.But My Page get Postbacks even i keep the update Panel.Here is my code:
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table cellpadding="0" cellspacing="0" width="100%" align="center">
<tbody class="descr">
<tr>
<td colspan="2" width="100%">
<div style="height: 20px;">
<asp:Label ID="lbladderror" runat="server" ForeColor="Red"></asp:Label>
</div>
</td>
</tr>
<tr>
<td valign="top" width="40%" align="right">
Choose :
</td>
<td valign="top" width="60%" align="center">
<asp:FileUpload ID="FileUploadpic" runat="server"/><br />
</td>
</tr>
</tbody>
</table>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnubmit" />
<asp:AsyncPostBackTrigger ControlID="btnaddcancel" />
</Triggers>
</asp:UpdatePanel>
<div class="btn">
<asp:ImageButton ID="btnubmit" runat="server" ImageUrl="~/Admin/images/submit.jpg"
OnClick="btnubmit_Click" Width="100px" Height="33px" /><asp:ImageButton ID="btnaddcancel"
ImageUrl="~/Admin/images/cancel.jpg" runat="server" Width="100px" Height="33px" />
</div>
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender2" runat="server" BackgroundCssClass="modalBackground"
PopupControlID="Panel3" TargetControlID="LinkButton2" CancelControlID="btnaddcancel"
DynamicServicePath="" Enabled="True">
</ajaxToolkit:ModalPopupExtender>
Can anyone pls tell me what is the problem in this code.thanks in Advance
stanly
Star
13201 Points
2490 Posts
Re: Update Panel in file Upload Control
Jan 23, 2013 11:32 AM|LINK
Refer this...
http://www.aspsnippets.com/Articles/Using-FileUpload-Control-inside-ASP.Net-AJAX-UpdatePanel-Control.aspx
http://csharpdotnetfreak.blogspot.com/2012/07/fileupload-in-updatepanel-false-aspnet.html
weblogs.asp.net/stanly
smanjula
Member
205 Points
349 Posts
Re: Update Panel in file Upload Control
Jan 23, 2013 11:36 AM|LINK
Hi Stanly,
Thanks for u r rply.I have already seen the above url u mentioned above.In the First URL,if u give AsyncPostBackTrigger it wont get the FileName.Iam having the same Problem.If i give PostbackTrigger,the Page is refreshed.Can u pls tell me any solution in AsyncPostBackTrigger to get the Filename?
stanly
Star
13201 Points
2490 Posts
Re: Update Panel in file Upload Control
Jan 23, 2013 11:40 AM|LINK
Why can't you Ajax AsyncFileUpload?
weblogs.asp.net/stanly
smanjula
Member
205 Points
349 Posts
Re: Update Panel in file Upload Control
Jan 23, 2013 11:46 AM|LINK
Hi Stanly,
No.In our Project Uniformly they are using Update Panel Only.
Ruchira
All-Star
43014 Points
7029 Posts
MVP
Re: Update Panel in file Upload Control
Jan 27, 2013 07:38 AM|LINK
Hello,
AFAIK, the default asp.net file uploader needs a full postback in order to upload the file in to the server. An Asynchronous call would not take the file with it. Either you need to use the file uploader inside an iframe or you will have to do a complete postback. If you need to keep your page while uploading the file, then simply place the fileuploader inside an iframe and do the uploading from there. Then the main page will remain same while it uploads the file inside the iframe.
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.