AJAX Asyncfileupload - how to refresh updatepanel after UploadedComplete

M

Mel

I am using the latest AJAX control toolkit (4.1.51116.0). I have a
modalpopupextender, AsyncFileUpload and a gridview inside an update
panel in my web user control (.ascx) page . The modal popup extender
appears and after the upload I want to update the gridview to display
some of the data I read in from the file. I have search Goole forever
and tried many solutions and I can't figure it out. Please help.
 
M

Mel

I am using the latest AJAX control toolkit (4.1.51116.0).  I have a
modalpopupextender, AsyncFileUpload and a gridview inside an update
panel in my web user control (.ascx) page .  The modal popup extender
appears and after the upload I want to update the gridview to display
some of the data I read in from the file.  I have search Goole forever
and tried many solutions and I can't figure it out.  Please help.

Nevermind. I finally got it. Here is my ascx file if this helps
anyone out there.

<%@ Control Language="VB" AutoEventWireup="false"
CodeFile="ImportSubstrates.ascx.vb"
Inherits="ImportSubstrates" %>
<%@ Register Assembly="AjaxControlToolkit"
Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:ModalPopupExtender ID="mpeImportSubstrates" runat="server"
BehaviorID="behidImp"
TargetControlID="Button2" PopupControlID="pnlImportSubstrates"
CancelControlID="btnImpDone"
BackgroundCssClass="modalBackground" />
<asp:panel ID="pnlImportSubstrates" Style="display: none"
runat="server" CssClass="modalPopup"
Width="1000px">
<center>
<b>Import Data</b></center>
<br />
Select the Excel file: <br />
<div id="divImpSubmit" class="divSubstrateSubmit">
<asp:AsyncFileUpload runat="server" ID="AsyncFileUpload1"
Width="800px" UploadingBackColor="#CCFFFF" ThrobberID="myThrobber" />

&nbsp;<asp:Label runat="server" ID="myThrobber"
Style="display: none;"><img align="middle" alt="" src="images/
uploading.gif" /></asp:Label>
<asp:UpdatePanel ID="upImportedSubstrates" runat="server">
<asp:Label ID="lblStatus"
runat="server" Text=""></asp:Label> <br /><br />
<asp:GridView ID="gvSubstrates" runat="server" CellPadding="2"
AutoGenerateColumns="False"
EmptyDataText="No substrates have been imported."
ForeColor="#333333">
<Columns>
<asp:TemplateField HeaderText="Item"
SortExpression="Item" ItemStyle-Wrap="False">
<EditItemTemplate>
<asp:TextBox ID="txtItem" runat="server"
Text='<%# Bind("Item") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblItem" runat="server" Text='<
%# Bind("Item") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Desc"
SortExpression="Desc" ItemStyle-Wrap="False">
<EditItemTemplate>
<asp:TextBox ID="txtDesc" runat="server"
Text='<%# Bind("Desc") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblDesc" runat="server" Text='<
%# Bind("Desc") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="UM" SortExpression="UM"
ItemStyle-Wrap="False">
<EditItemTemplate>
<asp:TextBox ID="txtUM" runat="server" Text='<
%# Bind("UM") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblUM" runat="server" Text='<%#
Bind("UM") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Qty"
SortExpression="Qty" ItemStyle-Wrap="False">
<EditItemTemplate>
<asp:TextBox ID="txtQty" runat="server" Text='<
%# Bind("Qty") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblQty" runat="server" Text='<
%# Bind("Qty") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-
Bold="True" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333"
HorizontalAlign="Left" />
<PagerStyle BackColor="#284775" ForeColor="White"
HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True"
ForeColor="#333333" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True"
ForeColor="White" />
<AlternatingRowStyle BackColor="White"
ForeColor="#284775" />
<SortedAscendingCellStyle BackColor="#E9E7E2" />
<SortedAscendingHeaderStyle BackColor="#506C8C" />
<SortedDescendingCellStyle BackColor="#FFFDF8" />
<SortedDescendingHeaderStyle BackColor="#6F8DAE" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div id="divDone" class="divSubstrateDone">
<asp:Button ID="btnImpDone" runat="server" Text="Close"
Width="50px" ValidationGroup="import" />
</div>
</asp:panel>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top