problem with refresh

  •  01-30-2014, 6:13 PM

    problem with refresh

    Good morning I have a problem with refreshing window.

    i found a post  about my problem, i tried to paste the same code but it didn't work.

    I use an external file to upload files and to insert records in a db, the file is  called by "var handleerurl=NAMEPAGE"

    so ... i think my uploader work with postback ...

    If i paste the solution i found here highlited in orange ... (<a href=/cutesoft.net/forums/post/67175.aspx">http://cutesoft.net/forums/post/67175.aspx</a>)&nbsp;the function didn't upload aniythings... 

     

    PLEASE!

    can u help me

    best regards

    Antonio

     

     

    <!DOCTYPE html>

    <html>

    <head>

    <meta charset="utf-8" />

    <title>servizi persona</title>

    <meta name="description" content="AA" />

    <meta name="keywords" content="AA" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

    <meta name="copyright" content="" />

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <meta http-equiv="Pragma" content="no-cache" />

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <!--css-->

    <link href="../scripts/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />

    <link href="../scripts/bootstrap/css/bootstrap-theme.css" rel="stylesheet" type="text/css" />

    <link href="../scripts/css/custom-responsive.css" rel="stylesheet" type="text/css" />

    <link href="../scripts/css/custom.css" rel="stylesheet" type="text/css" />

    <link href="../scripts/css/font-awesome.min.css" rel="stylesheet" type="text/css" />

    <link href="../scripts/css/cPanelStyle.css" rel="stylesheet" type="text/css" />

    <!--scripts-->

    <script src="../scripts/jQuery.v1.9.0.js" type="text/javascript"></script>

    <script src="../scripts/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>

    <script src="../scripts/jquery.mobilemenu.js" type="text/javascript"></script>

    <script src="../scripts/incCommonJavascript.js" type="text/javascript"></script>

    <script type="text/javascript">

    function confDelete()

    {

    conferma=confirm("Procedere con la rimozione?")

    if (conferma==true)

    {

    return true

    }

    else

    {

    return false

    }

    }

    </script>

    <script type="text/javascript">

    function DoMyAjax(guidlist, deleteid) {

    guidlist = guidlist || "";

    deleteid = deleteid || "";

    //Send Request

    var xh;

    var handlerurl = 'misc-filemanager-handler.asp?WArea=docs&cPage=77&cDoc=0'

    if (window.XMLHttpRequest)

    xh = new window.XMLHttpRequest();

    else

    xh = new ActiveXObject("Microsoft.XMLHTTP");

    xh.open("POST", handlerurl, false, null, null);

    xh.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");

    xh.send("guidlist=" + guidlist + "&deleteid=" + deleteid);

    if (xh.status != 200) {

    alert("http error " + xh.status);

    setTimeout(function () { document.write(xh.responseText); }, 10);

    return;

    }

    var filelist = document.getElementById("filelist");

    var div = document.getElementById("myfilescontainer");

    //alert(xh.responseText);

    var list = eval(xh.responseText); //get JSON objects

    if (list.length > 0) {

    var table = document.createElement("TABLE");

    table.border = 1;

    table.cellSpacing = 0;

    table.cellPadding = 4;

    table.style.borderCollapse = "collapse";

    table.style.width = "640px";

    var th = table.insertRow(-1);

    th.style.backgroundColor = "steelblue";

    th.style.color = "white";

    th.style.textAlign = "center";

    th.insertCell(-1).innerHTML = "Time";

    th.insertCell(-1).innerHTML = "FileName";

    th.insertCell(-1).innerHTML = "Size";

    th.insertCell(-1).innerHTML = "&nbsp;";

    //Process Result:

    for (var i = 0; i < list.length; i++) {

    var item = list[i];

    var row = table.insertRow(-1);

    var td1 = row.insertCell(-1);

    var td2 = row.insertCell(-1);

    var td3 = row.insertCell(-1);

    var td4 = row.insertCell(-1);

    td1.style.width = "160px";

    td1.innerHTML = item.UploadTime;

    td2.innerHTML = "<a href='" + item.FileUrl + "' target='_blank'>" + item.FileName + "</a>";

    td2.title = item.Description;

    td3.style.width = "80px";

    td3.style.textAlign = "right";

    td3.innerHTML = item.FileSize;

    td4.style.width = "45px";

    td4.innerHTML = "<a href='BLOCKED SCRIPTvoid(0)' onclick='DoMyDelete(\"" + item.FileName + "\",\"" + item.FileID + "\");return false;'>Delete</a>";

    }

    div.innerHTML = "";

    div.appendChild(table);

    }

    else {

    div.innerHTML = "<div style='padding:8px;border:solid 1px steelblue;color:maroon;'>Non risultano documenti caricati per la pratica selezionata.</div>";

    }

    }

    function CuteWebUI_AjaxUploader_OnPostback() {

    var uploader = document.getElementById("myuploader");

    var guidlist = uploader.value;

    DoMyAjax(guidlist);

    uploader.reset();

            window.location.href="http://www.domain.com/page.asp?File="+fileName;         

    }

     

    </script>

    </head>

    <body>

    <table class="tableList" style="width:100%;">

    <tr class="TableHeader">

    <td colspan="2" class="text-center"> BLOCCATO DOCUMENTI e ALLEGATI </td>

    </tr>

    <tr>

    <td style="width:40%;">

    <input type='hidden' id='myuploader' name='myuploader' autocomplete='off' /><script type='text/javascript' src='/SiteAdmin/aspuploader/ajaxuploaderresource.asp?type=script'></script><img id='AjaxUploaderFiles_Loader' UniqueID='myuploader' Namespace='CuteWebUI' UploadModuleNotInstall='1' ServerLang='ASP' src='/SiteAdmin/aspuploader/ajaxuploaderresource.asp?type=file&amp;file=continuous.gif' ResourceHandler='/SiteAdmin/aspuploader/ajaxuploaderresource.asp' ResourceDirectory='/SiteAdmin/aspuploader/resources' UploadUrl='/SiteAdmin/aspuploader/ajaxuploaderhandler.asp' InsertButtonID='uploadbutton' Extensions='*.doc,*.docx,*.pdf,*.xls,*.xlsx,*.zip,*.txt' MaxSizeKB='15360' CancelUploadMsg='Cancel&nbsp;upload' CancelAllMsg='Cancel&nbsp;all&nbsp;Uploads' UploadingMsg='Uploading..' UploadType='Auto' UploadCursor='Auto' MultipleFilesUpload='1' ShowProgressBar='1' ShowProgressInfo='1' NumFilesShowCancelAll='2' PanelWidth='360' BarHeight='20' InfoStyle='padding-left:3px;font:normal&nbsp;12px&nbsp;Tahoma;' BarStyle='Continuous' BorderStyle='border-style:solid;border-width:1px;border-color:#444444;' onload='this.style.display=&quot;none&quot; ; CuteWebUI_AjaxUploader_Initialize(this.id);' onerror='this.onload()' ContextValue='373661397' />

    <button type="submit" name="uploadbutton" value=" bloccato " class="btn btn-primary" id="uploadbutton"><i class="glyphicon glyphicon-compressed"></i> SFOGLIA E CARICA </button>

    <br /><br />documenti consentiti:<br />*.doc,*.docx,*.pdf,*.xls,*.xlsx,*.zip,*.txt<br />

    <br />dimensione massima file 15Mb<br /><br /><br />

    <form action="?WArea=docs&cPage=77&cDoc=0" method="post" name="Form" >

    <table class="table">

    <tr>

    <td class="text-right"><h3>Descrizione</h3></td>

    <td><div class="form-group"><input type="text" name="dDoc" maxlength="256" class="form-control" value="" /></div></td>

    </tr>

    <tr>

    <td class="text-right"><h3>Tipo</h3></td>

    <td><div class="form-group"><select name="cKofDoc" class="form-control input-sm" ><option value=""> > Seleziona </option><option value="1">Contabile </option><option value="0">Generico </option></select></div></td>

    </tr>

    <tr>

    <td class="text-right"><h3>Ordine</h3></td>

    <td><div class="form-group"><input type="number" name="orderDoc" value="" class="form-control" style="width:60px;" /></div></td>

    </tr>

    <tr>

    <td class="text-right"><h3>Visibile</h3></td>

    <td><div class="form-group"><select name="isVisible" class="form-control input-sm "> <option value="0" style="color:Red" > > [ NO ] </option> <option value="1" style="color:Green" > [ SI ] </option> <option value="0" style="color:Red" > [ NO ] </option> </select></div></td>

    </tr>

    <tr>

    <td class="text-right"><h3>Riservatezza</h3></td>

    <td><div class="form-group"><select name="cSeverity" class="form-control input-sm" ><option value="1"> > Pubblico </option><option value="1">Autenticato </option></select></div></td>

    </tr>

    <tr>

    <td colspan="2" class="text-right bgGrey">

    <button type="submit" name="actionForm" value="rimuovi" class="btn btn-danger" onclick="return confDelete();"><i class="glyphicon glyphicon-trash colorWhite"></i> RIMUOVI </button>

    <button type="submit" name="actionForm" value=" bloccato " class="btn btn-primary" disabled="disabled" ><i class="glyphicon glyphicon-floppy-disk"></i> bloccato </button>

    </td>

    </tr>

    </table>

    <br />

    <input type="hidden" name="cPage" value="77" />

    <input type="hidden" name="cUser" value="0" />

    <input type="hidden" name="cDoc" value="0" />

    <input type="hidden" name="WArea" value="docs" />

    </form>

    </td>

    <td style="width:60%; background-color:#f9f9f9; vertical-align:top;" class="text-center">

    </td>

    </tr>

    </table>

    </body>

    </html>

View Complete Thread