PC Review


Reply
Thread Tools Rating: Thread Rating: 2 votes, 1.00 average.

AJAX Asyncfileupload - how to refresh updatepanel after UploadedComplete

 
 
Mel
Guest
Posts: n/a
 
      18th Jan 2012
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.
 
Reply With Quote
 
 
 
 
Mel
Guest
Posts: n/a
 
      18th Jan 2012
On Jan 18, 9:24*am, Mel <mlights...@gmail.com> 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>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:59 AM.