Skip to content

Infragistics Community Forum / Web / Ignite UI for ASP.NET Core / Unable to create grid using Html.Infragistics().Grid() and get error "Unexpected token '<'

Unable to create grid using Html.Infragistics().Grid() and get error "Unexpected token '<'

New Discussion
Pui Yee Poon
Pui Yee Poon asked on Jan 21, 2026 1:28 PM

Hi,

I recently create a new .NET 6 web app project and want to use igGrid in my project. I was used to the C# MVC way (Html.Infragistics().Loader() $ Html.Infragistics().Grid()) to create the grid (instead of jquery way like $.ig.Loader & $(‘#id’).igGrid({})) but it return error “SyntaxError: Unexpected token ‘<‘, ” <script Ty”… is not valid JSON“.

Project structure, all IgniteUI css and js files are under wwwroot folder:

Nuget package: Infragistics.Web.AspNetCore (6.22.2.7)

The css and scripts referenced:
<link href=”/css/themes/infragistics/infragistics.theme.css” rel=”stylesheet” />
<link href=”/css/structure/infragistics.css” rel=”stylesheet” />
<script src=”“>code.jquery.com/…/script>
<script src=”“>code.jquery.com/…/script>
<script src=”/js/infragistics.core.js”></script>
<script src=”/js/infragistics.lob.js”></script>
<script src=”/js/infragistics.loader.js”></script>

Then, I have my controller code that return dummy records array to the Workbench.cshtml partial view.
Workbench.cshtml:

@using Infragistics.Web.Mvc
@model TestProjecte.Models.DummyModel

@(Html.Infragistics().Loader()
            .ScriptPath(Url.Content("/js/"))
            .CssPath(Url.Content("/css/"))
            .Theme("bootstrap")
            .Render())

@(Html.Infragistics().Grid(Model.Records.AsQueryable())
                .ID("tblRecords")     
                .FixedHeaders(true)
                .DefaultColumnWidth("130px")
                .AutoGenerateColumns(false)
                .Columns(column =>
                {
                    column.For(x => x.Id).HeaderText("Id").ColumnCssClass("text-center").HeaderCssClass("text-center");                    
                    column.For(x => x.StartTime).HeaderText("Start Time").ColumnCssClass("text-center").HeaderCssClass("text-center").DataType("date").Format("yyyy-MM-dd HH:mm:ss.fff").Width("200px");
                    column.For(x => x.EndTime).HeaderText("End Time").ColumnCssClass("text-center").HeaderCssClass("text-center").DataType("date").Format("yyyy-MM-dd HH:mm:ss.fff").Width("200px");
                    column.For(x => x.Dur).HeaderText("Duration (s)").ColumnCssClass("text-center").HeaderCssClass("text-center");                    
					column.For(x => x.Location).HeaderText("Location").ColumnCssClass("text-center").HeaderCssClass("text-center");
                })                
                .Virtualization(false)
                .Render())

May I know what did I miss out, is it missing Nuget package reference, wrong jquery version, or the way I use Html.Infragistics().Loader() is wrong (I was coming from .NET Framework project which creates the grid this way)? Any pointer or help is great, thanks!

Sign In to post a reply

Replies

  • 0
    Pui Yee Poon
    Pui Yee Poon answered on Apr 10, 2023 6:19 AM

    My mistake, found out the issue was me declaring ajax call response data type 'json' which should really be 'html' since I'm returning a PartialView from controller.
    However, there's still issue with the grid, I can only see the table header and all rows are blank, there is an error coming from infragistics.ui.grid.filtering.js: "Cannot read properties of undefined (reading 'getEditor')" not sure if this is related?

    • 0
      N. Ishibashi
      N. Ishibashi answered on Apr 10, 2023 9:40 AM

      Hello,

      I'm investigating your issue. When I have any update about it, I'll let you know. So could you wait for a while?

      Thank you in advance.

      • 0
        Asher Brien
        Asher Brien answered on Oct 25, 2024 5:30 AM

        Please continue to post such enlightening and informative blogs. You’re motivating people like us in real life. I would also like to add some more details I found on your website https://www.904homebuyer.com/sell/jacksonville-beach-fl

    • 0
      N. Ishibashi
      N. Ishibashi answered on Apr 13, 2023 6:15 AM

      I have investigated your issue, and I have asked our engineering staff to examine this further.  To ensure that it will receive attention, I have logged this behavior in our internal tracking system with a Development ID of 275222. This will be assigned to a developer in a future sprint to review my investigation and confirm my findings or to offer a fix, or other resolution.

      Please let me know if you need more information.

      • 0
        Colleen Aguirre
        Colleen Aguirre answered on Apr 15, 2023 12:14 PM

        Any update? I looked online for essay writing services since I had an essay assignment to finish. At https://www.topessaywriting.org/samples/grit I discovered this website. where I may read reviews of many websites that help me write essays and browse through them to help me pick the best one.

      • 0
        N. Ishibashi
        N. Ishibashi answered on Apr 19, 2023 2:01 AM

        We investigated the issue and found out that it's solved by calling DataBind() before Render(), like this:

        @(Html.Infragistics().Grid(Model.Records.AsQueryable())
        .ID("tblRecords")
        @* … skipping some codes … *@
        .DataBind()
        .Render())

        Could you give it a try?

      • 0
        Pui Yee Poon
        Pui Yee Poon answered on Apr 19, 2023 2:35 AM

        Tested and it is the missing DataBind() causing the issue, now I can see the full table. Thank you!

    • 0
      Vansh Sharma
      Vansh Sharma answered on Oct 19, 2023 6:58 AM

      So if you are travelling by the town, and want to book call girls in Delhi on highway Kharghar, then you can message us on our WhatsApp number. Delhi Call Girls  Our seamless call girls will come to you and make you feel sexy about everything. If you book a single independent call girl in Delhi, you will get to witness her naked beauty for the whole night.

  • 0
    Kunal Tomar
    Kunal Tomar answered on Mar 7, 2024 5:44 AM

    Nothing is impossible until you try to do it. Now, we tried 24×7 Ashram Escorts with free home delivery for IN-Call and OUT-Call, and we were successful. From here on out, we are more aware of customer satisfaction and their privacy. Hence, we have the original pictures of Ashram Call Girls listed on our website.

    • 0
      Arthur Davido
      Arthur Davido answered on May 13, 2024 9:23 PM

      I've been using Masterpapers.com english paper writing service for all my custom paper writing needs, and I couldn't be happier with the results. Their writers are incredibly talented and always deliver top-notch work, no matter the subject or deadline.english paper writing service

  • 0
    Arthur Davido
    Arthur Davido answered on May 13, 2024 9:24 PM

    I've been using https://www.masterpapers.com/ for all my custom paper writing needs, and I couldn't be happier with the results. Their writers are incredibly talented and always deliver top-notch work, no matter the subject or deadline.

  • 0
    Awnex Baylor
    Awnex Baylor answered on Jan 21, 2026 1:28 PM

    Looks like the main issue is that the Html.Infragistics() helpers from older .NET MVC projects are not fully supported in .NET 6, since ASP.NET Core handles scripts and server-side helpers differently, which is why you’re seeing the Unexpected token '<' error—it usually happens when the server is returning HTML instead of JSON that the grid expects. In .NET 6, it’s recommended to use the jQuery-based approach with $.ig.Loader and $('#id').igGrid({...}), ensuring that your jQuery version matches the IgniteUI requirements and that all scripts are loaded in the correct order after jQuery. Also, double-check that your controller action is returning JSON properly via return Json(data) rather than a partial view when the grid expects data. For example, while working on performance monitoring tools like a PC Bottleneck Finder, ensuring the correct JSON response and script initialization sequence is key, and adopting the jQuery initialization method in ASP.NET Core will resolve the “Unexpected token '<'” issue efficiently.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Pui Yee Poon
Favorites
0
Replies
12
Created On
Jan 21, 2026
Last Post
1 month, 1 week ago

Suggested Discussions

Created by

Created on

Jan 21, 2026 1:28 PM

Last activity on

Feb 25, 2026 9:51 AM