jQuery UI Widgets Forums Grid JQXGRID WITH ASP .NET WEBFORM INTEGRATION

This topic contains 1 reply, has 2 voices, and was last updated by  svetoslav_borislavov 2 weeks, 1 day ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • JQXGRID WITH ASP .NET WEBFORM INTEGRATION #129057

    bardellisalud
    Participant

    Hello, my name is Christian, I am new using this framework, and I had some problems with asp .net integration. With PHP all works well.

    Here is my example:

    <%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”Login18.aspx.cs” Inherits=”apps_login_Login18″ %>

    <!DOCTYPE html>

    <html xmlns=”http://www.w3.org/1999/xhtml”>
    <head>
    <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″/>
    <title></title>
    <link rel=”stylesheet” href=”../../frameworks/jqwidgets/styles/jqx.base.css” type=”text/css” />
    <link rel=”stylesheet” href=”../../frameworks/jqwidgets/styles/jqx.classic.css” type=”text/css” />
    <script type=”text/javascript” src=”../../frameworks/jquery/3.6.0/jquery.js” ></script>
    <script type=”text/javascript” src=”../../frameworks/jqwidgets/jqxcore.js”></script>
    <script type=”text/javascript” src=”../../frameworks/jqwidgets/jqxbuttons.js”></script>
    <script type=”text/javascript” src=”../../frameworks/jqwidgets/jqxscrollbar.js”></script>
    <script type=”text/javascript” src=”../../frameworks/jqwidgets/jqxmenu.js”></script>
    <script type=”text/javascript” src=”../../frameworks/jqwidgets/jqxgrid.js”></script>
    <script type=”text/javascript” src=”../../frameworks/jqwidgets/jqxdata.js”></script>
    <script type=”text/javascript” src=”../../frameworks/jqwidgets/jqxgrid.selection.js”></script>
    <script type=”text/javascript” src=”../../frameworks/jqwidgets/jqxgrid.edit.js”></script>
    <script type=”text/javascript” src=”../../frameworks/jqwidgets/jqxgrid.pager.js”></script>
    <script type=”text/javascript”>
    $(document).ready(function () {
    //Getting the source data with ajax GET request
    source = {
    type: “GET”,
    datatype: “json”,
    datafields: [
    { name: ‘CompanyName’, type: ‘string’ },
    { name: ‘ContactName’, type: ‘string’ }

    ],
    url: ‘Login18.aspx/GetCustomers’,
    cache: false,
    // async: false,
    root: ‘data’,
    // async: false,
    };
    var dataAdapter = new $.jqx.dataAdapter(source, {
    contentType: ‘application/json; charset=utf-8’,
    downloadComplete: function (data, textStatus, jqXHR) {
    alert(data.d);
    return data.d;
    }
    }
    );
    $(“#jqxgrid”).jqxGrid({
    source: dataAdapter,
    columns: [
    { text: ‘Company Name’, datafield: ‘CompanyName’, width: 250 },
    { text: ‘ContactName’, datafield: ‘ContactName’, width: 150 }

    ]
    });
    });
    </script>
    </head>
    <body>
    <div id=”jqxgrid”></div>

    </body>
    </html>

    The WebMethod:

    using db_sql;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Script.Services;
    using System.Web.Services;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public partial class apps_login_Login18 : System.Web.UI.Page
    {
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    [WebMethod]
    [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
    public static string GetCustomers()
    {
    // db_server con = new db_server();
    string query = “SELECT * FROM Customers LIMIT 100”;
    // query = con.GetSerialized(query, “json”);
    query = “[{‘CompanyName’:’Alfreds Futterkiste’,’ContactName’:’Maria Anders’,’ContactTitle’:’Sales Representative’,’Address’:’Obere Str. 57′,’City’:’Berlin’}]”;
    return query;
    }
    }

    For some reason, when the server response, the jqxgrid stay in loading …

    Thank you.

    JQXGRID WITH ASP .NET WEBFORM INTEGRATION #129956

    Hi,

    Please see this tutorial to get familiar: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/asp.net-integration/asp.net-web-service-grid.htm?search=

    You can also send a code sample here: support@jqwidgets.com

    Best regards,
    Svetoslav Borislavov

    jQWidgets Team
    https://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.