UpdatePanel doesnt work as intended for file upload control

Posted by Sharpcnet under ASP.NET on 2/18/2014 | Points: 10 | Views : 793 | Status : [Member] | Replies : 3
When I click on the attach button, It adds a new row to the grid with the postedFile name. But its also causing the whole page to refresh, as if the updatePanel doesnt exist. Whereas, I would like just the gridview to update. Why does this have to be this way with file upload controls. The UpdatePanel works as desired for other controls/grids on page.

I do not have a knowledge on jquery, so have to work it out only with c#. Any suggestions.

<asp:updatepanel runat="server" updatemode="conditional">
<triggers>
<asp:postbacktrigger controlid="btnAttach"/>
</triggers>
<contenttemplate>
<asp:gridview ...../>
<asp:fileupload id="fup" runat="server">
<asp:button id="btnAttach" text="attach" runat="server/>
</contenttemplate>
</asp:updatepanel>





Responses

Posted by: Antonydurai on: 2/28/2014 [Member] Starter | Points: 25

Up
0
Down
use
<asp:AsyncPostBackTrigger controlid="btnAttach"/>

instance of
<asp:postbacktrigger controlid="btnAttach"/>



Sharpcnet, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sravan661 on: 2/28/2014 [Member] Bronze | Points: 25

Up
0
Down
Hope this helps you
Revert if you has any issues

Mark as answer if u are satisfies

sravan

Sharpcnet, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response