Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: Ajax VB.NET
How can I use the AsyncFileUpload control from ajaxtoolkit in
Posted 10-Aug-12 0: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 at 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
0 CHill60 360
1 Sarvesh Kumar Gupta 238
2 OriginalGriff 193
3 Sergey Alexandrovich Kryukov 163
4 DamithSL 153

Advertise | Privacy | Mobile
Web03 | 2.8.140709.1 | Last Updated 10 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid