2017-07-14 4 views
0

J'utilise Jqgrid pour l'édition en ligne avec asp.net et en utilisant un fichier handler.ashx pour stocker les valeurs de la grille. Il fonctionne parfaitement bien dans mon VS mais quand je publie et l'exécute sur iis il trows erreur.Fichier Jqgrid Inline Error Handler introuvable lors de son utilisation avec asp.net

suivant est le code pour jqGrid

$("#grid-table-Labor").jqGrid({ 
        url: 'LaborApproval.aspx/GetLaborData', //asp function to get all data from data base to grid 
        data: "{}", 
        datatype: 'json', 
        mtype: 'POST', 
        serializeGridData: function (postData) { 
         return JSON.stringify(postData); 
        }, 
        ajaxGridOptions: { contentType: "application/json" }, 
        loadonce: true, 
        colNames: [' ', 'Employee Code', 'Name', 'Contractor', 'DOJ', 'Police Verification', 'Gate Pass Valid Upto', 'Status', 'Remark'], 
        colModel: [ 
            { 
             name: 'myac', index: 'myac', width: 80, fixed: true, sortable: false, resize: false, formatter: 'actions', 
             formatoptions: { 
              keys: true, 
              delbutton: false, 
              editOptions: {}, 
              addOptions: {}, 
              delOptions: {} 
             } 
            }, 
            { name: 'EMPCODE', index: 'EMPCODE', width: 108, key: true }, 
            { name: 'NAME', index: 'NAME', width: 140 }, 
            { name: 'CONTNAME', index: 'CONTNAME', width: 160 }, 
            { name: 'DOJ', index: 'DOJ', width: 70, formatter: 'date', formatoptions: { newformat: 'd-m-y' } }, 
            { name: 'POLICE_VRIFICATION', index: 'POLICE_VRIFICATION', width: 124 }, 
            { name: 'GatePassValidUpto', index: 'GatePassValidUpto', editable: true, sorttype: "date", unformat: pickDate }, 
            { name: 'Approve', index: 'Approve', width: 148, editable: true, edittype: "select", editoptions: { value: "True:Approve;False:Rejected" } }, 
            { name: 'REMARK', index: 'REMARK', width: 150, sortable: false, editable: true, edittype: "textarea", editoptions: { rows: "2", cols: "10" } } 
        ], 
        pager: '#grid-pager-Labor', 
        altRows: true, 
        //cacheUrlData: true, 
        //toppager: true, 
        rowNum: 10, 
        scrollOffset: 0, // to remove offset of scroll bar for imporved gui 
        rowList: [10, 50, 100, 200, 300, 500, 800, 1000, 1500], 
        //onSelectRow: editRow, 
        viewrecords: true, 
        emptyrecords: "Nothing to display", 
        //multiselect: true, 
        //multiboxonly: false, 
        gridview: true, 
        loadComplete: function() { 
         var table = this; 
         setTimeout(function() { 
          //styleCheckbox(table); 
          //updateActionIcons(table); 
          updatePagerIcons(table); 
          enableTooltips(table); 
         }, 0); 
        }, 
        jsonReader: { 
         page: function (obj) { return 1; }, 
         total: function (obj) { return 1; }, 
         records: function (obj) { return obj.d.length; }, 
         root: function (obj) { return obj.d; }, 
         repeatitems: false, 
         id: "0" 
        },      
        editurl: 'Handler/JQGridHandler.ashx', 
        caption: 'Labor List', 
        shrinkToFit: true, 
        height: 'auto', 
        //autowidth: true, 
        xmlReader: { 
         root: "list", 
         row: "Response", 
         id: "cfgId", 
         repeatitems: false 
        }, 
        beforeSelectRow: function (rowid, e) { 

         var iCol = $.jgrid.getCellIndex($(e.target).closest("td")[0]); 
         if (this.p.colModel[iCol].name === 'EMPCODE') {              
          var param = { param: rowid }; 

          console.log(rowid); 
          $.ajax({ 
           url: "LaborApproval.aspx/ShowMe",         
           data: JSON.stringify(param), 
           dataType: "json", 
           type: "POST", 
           contentType: "application/json; charset=utf-8",       
           success: function (data) { 
            console.log(data);                    
              var box = bootbox.dialog({ 
                show: true, 
                message: data['d'], 
                title: "Labour Details", 
                buttons: { 
                 ok: { 
                  label: "OK", 
                  className: "btn-primary", 
                  callback: function() { 
                   console.log('OK Button'); 
                  } 
                 }         
                } 
              }); 
              box.modal('show'); 
             }, 
           error: function (XMLHttpRequest, textStatus, errorThrown) { 
            var err = eval("(" + XMLHttpRequest.responseText + ")"); 
            alert(err.Message) 
            // console.log("Ajax Error!"); 
           } 
          }); 

          return false; 
         } 
        } 
       }); 

et qui suit est l'erreur

[HttpException]: The file '/CMS/Web_Pages/HR_Pages/Handler/JQGridHandler.ashx' does not exist. 

    at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) 

    at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) 

    at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) 

    at System.Web.UI.SimpleHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) 

    at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 

    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 

--> 
+0

Est-ce que ce fichier existe sur votre IIS? – mjwills

+0

oui dans le dossier du gestionnaire –

+0

Quel est le nom du fichier @Lord_of_Lucifer? – mjwills

Répondre

0

Je viens de mettre

editurl: '../../Handler/JQGridHandler.ashx', 

avant que le lien