views:

28

answers:

1

I have an AJAX AsycFileupload in my asp page. When I uploaded a file to a folder "upload", an error message was displayed in the page "Object doesn't support this property or method". //in the script tag

function uploadError(sender, args) 
    {
        document.getElementById('lbl_status').innerText = args.get_fileName() + " "+   args.get_errorMessage();
    }

<asp:AsyncFileUpload ID="AsyncFileUpload1" width="400px" 
                OnClientUploadStarted="startUpload" OnClientUploadComplete="uploadComplete" 
                OnClientUploadError="uploadError" ThrobberID="Throbber" 
                    runat="server" onuploadedcomplete="AsyncFileUpload1_UploadedComplete" 
                    UploadingBackColor="#66CCFF" CompleteBackColor="White" 
                    ErrorBackColor="#FF3E3E"/>
                <asp:Label ID="Throbber" runat="server" Style="display:none">
                <img src="Images/indicatorblue.gif" align="middle" alt="loading"/>
                 </asp:Label>
                 <asp:Label ID="lbl_status" runat="server" Style="font-family: Arial;font-size: small;">
                 </asp:Label>

Thank you for any help..

A: 

What seems to me is that you are accessing an object that is not created. Are you using a MasterPage (or your lbl_status is in an naming container)? if that is the case I would use:

function uploadError(sender, args) 
{
    document.getElementById('<%= lbl_status.ClientID %>').innerText = args.get_fileName() + " "+   args.get_errorMessage();
}

because the NamingContainers change the client ids.

Limo Wan Kenobi
Thanks for answer..
pRAVeEN
But I am not using any Master page...
pRAVeEN
Still I have the error... :(
pRAVeEN
Thanks for the reply..
pRAVeEN