troubleshooting Question

dat grid error with javascript

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

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

R8VI
<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.';
            __doPostBack(dlV);
            


        }
</Script>

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"
                   Visible="true">
                    <ItemTemplate>
                        
                    </ItemTemplate>
                </asp:DataList>
            </div>

Open in new window

ASKER CERTIFIED SOLUTION
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