Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Somehow the JQGrid is not invoking the aspx page function at all. I dont know what I am doing wrong. this is the first time, I am trying to use the combination of XML & aspx. I dont want to use the ASHX & JSON.
ASP.NET
<pre lang="xml"><script src="jqgrid/jquery-1.10.2.js" type="text/javascript"></script>
<script src="jqgrid/jquery-ui-1.10.4.custom.js" type="text/javascript"></script>
<script src="jqgrid/jquery-ui-1.10.4.custom.min.js" type="text/javascript"></script>
<script src="jqgrid/jquery.jqGrid.js" type="text/javascript"></script>
<script src="jqgrid/grid.locale-en.js" type="text/javascript"></script>

<asp:Content ID="Content1" ContentPlaceHolderID="headContent" runat="Server">
    <script type="text/javascript">
          $("#list").jqGrid({
            url: "XMLCheck.aspx/getData",
            datatype: "xmlstring",
            gridview: true,
            loadonce: true,
            mtype: "POST",
            colNames: ['Inv No', 'Date', 'Amount', 'Tax', 'Total', 'Notes'],
            colModel: [
            { name: 'invid', index: 'invid', width: 55, sorttype: 'int' },
            { name: 'invdate', index: 'invdate', width: 90, sorttype: 'date', datefmt: 'Y-m-d' },
            { name: 'amount', index: 'amount', width: 80, align: 'right', sorttype: 'float' },
            { name: 'tax', index: 'tax', width: 80, align: 'right', sorttype: 'float' },
            { name: 'total', index: 'total', width: 80, align: 'right', sorttype: 'float' },
            { name: 'note', index: 'note', width: 150, sortable: false }],
        });

        $("#list").jqGrid('filterToolbar', { search: true, searchOnEnter: false, searchOperators: false });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <table id="list"></table>
</asp:Content>



aspx page has
VB
<WebMethod> _
Public Shared Function getData() As String

        Return "<?xml version='1.0' encoding='utf-8'?><invoices><rows><row><cell>data1</cell><cell>data2</cell><cell>data3</cell><cell>data4</cell><cell>data5</cell><cell>data6</cell></row></rows></invoices>"

End Function
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900