Click here to Skip to main content
13,252,065 members (50,435 online)
Rate this:
Please Sign up or sign in to vote.
See more:
How can I use the AsyncFileUpload control from ajaxtoolkit in
Posted 10-Aug-12 1:34am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I am just writing an can alter it according to your requirement.

the script will be like this

<script type = "text/javascript" >
function getFileAs()
document.getElementById ("<%=txtFileAs.ClientId%>").value = document.getElementById ("<%=txtEmployeeName.ClientId%>").value
<script type = "text/javascript">
        function uploadComplete(sender) {
            $get("<%=lblStatus.ClientID%>").innerHTML = "File Uploaded Successfully";
        function uploadError(sender) {
            $get("<%=lblStatus.ClientID%>").innerHTML = "File upload failed.";

The asp control

<asp:AsyncFileUpload ID="AsyncFileUpload1"  OnClientUploadError="uploadError" OnClientUploadComplete="uploadComplete"
        runat="server"  UploaderStyle="Modern" CompleteBackColor="White"
        UploadingBackColor="#CCFFFF" ThrobberID="imgLoader" 
                FailedValidation="False" />
    <asp:Image ID="imgLoader" runat="server" ImageUrl="~/Images/indicator.gif" />
    <asp:Label ID="Throbber" runat="server" Style="display: none">
            <img src="~/Images/indicator.gif" align="absmiddle" alt="loading" />
            <asp:Label ID="lblStatus" runat="server" 
                Style="font-family: Arial; font-size: small;"></asp:Label>

The VB Code

Public Sub AsyncFileUpload1_UploadedComplete(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs)
        If AsyncFileUpload1.HasFile Then
            Session("link") = Path.GetFileName(e.FileName)
            Dim strPath As String = MapPath("~/Uploads/") + Path.GetFileName(e.FileName)
        End If
    End Sub
caspi.rulez 10-Aug-12 6:51am
nice ans...thanx :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 3


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171114.1 | Last Updated 10 Aug 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100