troubleshooting Question

dat grid error with javascript

Avatar of R8VI
R8VI asked on
.NET ProgrammingASP.NETC#
5 Comments1 Solution269 ViewsLast Modified:

I am using  ajax controol tool file upload to uplaod an image and then populate that image in a datagrid.

However what happens if it is the first time that I am uploading something then I get an error
"Unhandled Exception 'dlV' is undefined"

I am assuming this is because it can not find the datagrid

Code below

Please help

<script type="text/javascript" language="javascript">
        function UploadComplete(sender, args) {

            var fileupload = document.getElementById("asyncFileUpload1");
            if (fileupload != null) {
                document.getElementById("asyncFileUpload1").outerHTML = fileupload.outerHTML;


            document.getElementById('lblStatus').innerText = 'Uploading Completed.';


aspx page
               <cc1:AsyncFileUpload ID="asyncFileUpload1" runat="server" UploadingBackColor="LightGray"
                    CompleteBackColor="Lime" OnUploadedComplete="asyncUploadComplere" UploaderStyle="Modern"
                    ThrobberID="Throbber" OnClientUploadComplete="UploadComplete" OnClientUploadStarted="StartUpload"
                    Width="300px" />

            <div class="gallery">
                <asp:DataList ID="dlV" runat="server" RepeatColumns="4" RepeatDirection="Horizontal"

Open in new window

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros