AJAX Asyncfileupload - how to refresh updatepanel after UploadedComplete

Discussion in 'ASP .Net' started by Mel, Jan 18, 2012.

  1. Mel

    Mel Guest

    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.
     
    Mel, Jan 18, 2012
    #1
    1. Advertising

  2. Mel

    Mel Guest

    On Jan 18, 9:24 am, Mel <> wrote:
    > 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">
    <ContentTemplate>
    <asp:Button ID="cmdImport" runat="server" Text="Import Data" /
    ><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>
     
    Mel, Jan 18, 2012
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    481
    Rob Meade
    Aug 8, 2007
  2. Michael Schöller
    Replies:
    1
    Views:
    2,195
    Michael Schöller
    Nov 23, 2009
  3. Scooby Dog

    AsyncFileUpload fails in hidden panel

    Scooby Dog, Jun 18, 2010, in forum: ASP .Net
    Replies:
    0
    Views:
    599
    Scooby Dog
    Jun 18, 2010
  4. Mel
    Replies:
    0
    Views:
    968
  5. Replies:
    0
    Views:
    854
Loading...

Share This Page