本文介绍了使用ASP.NET MVC的JQGrid导致调用默认操作两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ASP.NET MVC中使用JQGrid并在文档中初始化网格,如下所示



I am using JQGrid in ASP.NET MVC and initializing the grid in document ready as below

jQuery("#grid1").jqGrid({
    colNames: ['Col1', 'Col2'],
    colModel: [
                { name: 'Col1', index: 'Col1', width: 2, sortable: false },
                { name: 'Col2', index: 'Col2', width: 2, sortable: false }
              ],
    onSelectRow: function (currid) {
        //doing some thing
    },
    autowidth: true,
    shrinkToFit: false,
    height: '100',
    width: '100%',
    rowNum: 2,
    pgtext: "",
    pgbuttons: false,
    viewrecords: true,
    imgpath: '@Url.Content("~/Content/images/jqgrid/")',
    toolbar: false,
    gridComplete: function () {
        $("tr.jqgrow:odd").css("background", "#DDDDDC");
    }
});



当准备好被触发时,最后它会对服务器调用默认页面操作,如下所示



控制器/动作?_search = false& nd = 1375859081229& rows = 2& page = 1& sidx =& sord = asc



我已经更换了上面网址中的控制器和操作名称。



为什么会出现这种情况?以及如何避免这种行为?


when the ready is fired and at end it does a server call to default page action as below

controller/action?_search=false&nd=1375859081229&rows=2&page=1&sidx=&sord=asc

I have replaced the controller and action name in the above url.

why is this behavior happening? and how to avoid this behavior?

推荐答案



当准备好被触发时,最后它会对服务器调用默认页面操作,如下所示



控制器/动作?_search = false& nd = 1375859081229& rows = 2& page = 1& sidx =& sord = asc



我已经更换了上面网址中的控制器和操作名称。



为什么会出现这种情况?以及如何避免这种行为?


when the ready is fired and at end it does a server call to default page action as below

controller/action?_search=false&nd=1375859081229&rows=2&page=1&sidx=&sord=asc

I have replaced the controller and action name in the above url.

why is this behavior happening? and how to avoid this behavior?


这篇关于使用ASP.NET MVC的JQGrid导致调用默认操作两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 20:17