How can i achieve this in code behind

  •  03-27-2009, 12:56 PM

    How can i achieve this in code behind

    Hello I would like the following javascript implemented in code behind the reason is I would like the submit to either upload or do something else depoending on some server validation
     

    <script type="text/javascript">

    function submitbutton_click()

    {

    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;

    }

     
    <.Script>
     
    Thanks
View Complete Thread