Re: How can i achieve this in code behind

  •  03-30-2009, 12:45 PM

    Re: How can i achieve this in code behind

    I keep getting an error object not supported I took out on the onclientclick event for the submit button and I am trying to upload by calling  the following function from code behind. I am using manual upload. When the user clicks on the submit button I would like to be able to know whether I have files in the queue, but I can't find a way to get this info from code behind
    Please advice
    Thanks

      Sub SubmitButton_Click(ByVal sender As Object, ByVal e As EventArgs)
    ScriptManager.RegisterStartupScript(Page, Type.GetType("System.String"), "Try Uploading", "StartUpload();", True)
     End Sub

    function StartUpload()

    {

     

    var submitbutton=document.getElementById('<%=SubmitButton.ClientID %>');

    var uploadobj=document.getElementById('<%=Uploader1.ClientID %>');

    //if(!window.filesuploaded)

     

    //{

     

     

    if(uploadobj.getqueuecount()>0)

    {

    uploadobj.startupload();

    }

    else

     

    {

    var uploadedcount=parseInt(submitbutton.getAttribute("itemcount"))||0;

    if(uploadedcount>0)

    {

    return true;

    }

    alert("Please browse files for upload");

    }

    // return false;

     

    //}

     

    // window.filesuploaded=false;

     

    // return true;

     

    }

     

View Complete Thread