0

The following code throwing error like "Could not complete the operation due to error 80020101"

on the file jquery-1.8.3.js:

<script language="javascript" type="text/javascript">

    $(document).ready(function () {
        var Details = '@Url.Content("~/Controller/ActionResult1?id=")';

        var id= $("#id").val();
        $('#pager').hide();

        Details = Details + id;

        alert(PropertyDetails);
        $("#list").jqGrid({

            url: Details,
            datatype: 'xml',
            cache: false,
            mtype: 'GET',
            width: 600,
            height: 234,
            colNames: ['Name', 'Address', 'Type'],
            colModel: [
            { name: 'Name', index: 'Name', width: 20, xmlmap: 'Name' },
            { name: 'Address', index: 'Address', width: 20, xmlmap: 'Address' },
            { name: 'Type', index: 'Type', width: 20, xmlmap: 'Type' },
            ],

            xmlReader: { repeatitems: false },
            pager: '#pager',
            rowNum: 10,
            sortname: 'invid',
            sortorder: 'desc',
            viewrecords: true,
            gridview: true,
            loadonce: true,
            shrinkToFit: true,
            scroll: false,
            altRows: true,
            loadComplete: function () {
                if ($('#list').getGridParam('records') > 10) {
                    $('#pager').show();
                }
            }

        });

    });

    </script>

<table id="list"><tr><td/></tr></table> 
<div id="pager"></div>  

my controller side.

 public ActionResult ActionResult1(string id)
        {
// code
}

1 Answer 1

1

modify script like this:

<script language="javascript" type="text/javascript">

    $(document).ready(function () {
         var Details = '@Url.Content("~/Controller/ActionResult1?id=';

         var id= $("#id").val();
         $('#pager').hide();

         Details = Details + id+'")';


        alert(PropertyDetails);
        $("#list").jqGrid({

            url: Details,
            datatype: 'xml',
            cache: false,
            mtype: 'GET',
            width: 600,
            height: 234,
            colNames: ['Name', 'Address', 'Type'],
            colModel: [
            { name: 'Name', index: 'Name', width: 20, xmlmap: 'Name' },
            { name: 'Address', index: 'Address', width: 20, xmlmap: 'Address' },
            { name: 'Type', index: 'Type', width: 20, xmlmap: 'Type' },
            ],

            xmlReader: { repeatitems: false },
            pager: '#pager',
            rowNum: 10,
            sortname: 'invid',
            sortorder: 'desc',
            viewrecords: true,
            gridview: true,
            loadonce: true,
            shrinkToFit: true,
            scroll: false,
            altRows: true,
            loadComplete: function () {
                if ($('#list').getGridParam('records') > 10) {
                    $('#pager').show();
                }
            }

        });

    });

    </script>
Sign up to request clarification or add additional context in comments.

3 Comments

I think sudarshan's code is fine except for the part I edited
Yes,but for the future searches would be nice to be a quality answer.
thanks guys, i resloved this problem, the problem is, i am calling jquery-1.8.3.js file in multiple places like shared path and page itself. i removed this in page level, then its worked for me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.