HtmlHelper <dynamic> doesn't contain a definition for Kendo....

2 Answers 2236 Views
General Discussions
GarfieldTech
Top achievements
Rank 1
GarfieldTech asked on 09 May 2019, 06:17 PM

Scan.cshmtl via View:

@(Html.Kendo().Grid<Main_Kendo.Models.ScannerViewModel>()                <---  Html.Kendo gets red underline error ??? 

.Name("Grid")         

.Columns(columns =>         

{             

columns.Bound(b => b.Scan).Width(140);             

columns.Bound(b => b.BarcodeImage).Width(140);             

columns.Bound(b => b.DropZone).Width(140);             

columns.Bound(b => b.EnteredBy).Width(100);             

columns.Bound(b => b.EnteredDate).Width(130);             

columns.Command(command => command.Destroy()).Width(110);         

})

Whatever below.... 

)

 

The error message:

HtmlHelper <dynamic> doesn't contain a definition for Kendo and no accessible extension method for 'Kendo' accepting a first argument of type HtmlHelper

Already have ScannerViewModel in Models folder, Kendo.Mvc was missing references that I added.   

2 Answers, 1 is accepted

Sort by
0
Accepted
Viktor Tachev
Telerik team
answered on 14 May 2019, 01:05 PM
Hi,

The error you are seeing can be observed when the Kendo.Mvc.UI namespace is not included in the web.config file. Please update the Views/web.config file so it includes Kendo.Mvc.UI. Like this:


<namespaces>
    <add namespace="System.Web.Mvc" />
    <add namespace="System.Web.Mvc.Ajax" />
    <add namespace="System.Web.Mvc.Html" />
    <add namespace="System.Web.Routing" />
    <add namespace="Kendo.Mvc.UI" />
</namespaces>

For more detail on creating application and referencing the Kendo widgets please check out the Creating Applications article

In case you have additional questions do not hesitate to contact us again.


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
GarfieldTech
Top achievements
Rank 1
commented on 20 Jun 2019, 05:46 PM

Hello Viktor,

Sorry took me long time to get with this.  I have added Kendo.Mvc.UI in the View/Web.config, still error? 

See attached for error message.

Viktor Tachev
Telerik team
commented on 25 Jun 2019, 11:27 AM

Hi,

This error can be observed if there is no reference to Kendo.Mvc.dll in the project. Check out the article below that describes in detail how you can add reference to Kendo.Mvc.dll:


In case the issue persists after this please send us the project so we can examine it locally and look for what is causing the behavior.


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Dwight
Top achievements
Rank 1
answered on 26 Apr 2021, 07:53 AM

I've got the same problem on ASP.net core

 

Viktor Tachev
Telerik team
commented on 28 Apr 2021, 11:18 AM

Hi Dwight,

 

Check out the article below that describes how you can add reference to the necessary resources:

https://docs.telerik.com/aspnet-core/getting-started/first-steps

 

In case the error continues, would you send us a sample project where it is replicated so we can examine it?

 

Regards,
Viktor Tachev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
GarfieldTech
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Dwight
Top achievements
Rank 1
Share this question
or