This is a migrated thread and some comments may be shown as answers.

Kendo UI and MVC Starting a new project

23 Answers 6475 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 16 Jul 2012, 09:07 AM
I am starting a new project.
I was going to use the usual MVC extensions, but i understand that Kendo UI is replacing those.
I installed Kendo UI for ASP.NET MVC using my Telerik Control Panel.
But when i try to start a new project I don't see any templates in my Visual Studio.
Either the installation did not work, or i am not doing this right.
Are there any instructions on how to start working with Kendo UI for MVC.
A maybe a short video?

Thanks.

23 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 16 Jul 2012, 09:19 AM
Hi Andrew,

 Currently the Kendo UI installer does not install any Visual Studio project templates. We will release those with a future update.

 You can check the introduction help topic for instructions how to get started.

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Andrew
Top achievements
Rank 1
answered on 25 Jul 2012, 10:06 AM
I have tried following the instructions.

But when i try to type in @(Html.Kendo()
kendo is not recognized.
'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'Kendo' and no extension method 'Kendo' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?)


Is there anything else that was omitted in the instructions i need to add?
0
Atanas Korchev
Telerik team
answered on 26 Jul 2012, 11:06 AM
Hi Andrew,

 The instructions provided in the introduction help topic should be sufficient. Can you confirm that you have added the required namespace to web.config? Are you using ASP.NET MVC 4? If yes you need to add binding redirects to your web.config.

 If you are still experiencing problems you could attach your project here and we will troubleshoot it.

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Andrew
Top achievements
Rank 1
answered on 26 Jul 2012, 11:40 AM
Hi Atanas,

I have created a ticket and posted the project for you to have a look.

0
Horizon Software
Top achievements
Rank 2
answered on 26 Jul 2012, 08:33 PM
I'm having the same experience; I've followed the instructions in the introduction article but when I get to the end and try adding the DatePicker line to my view I get the helper error. I'm using MVC3 and have a reference to the Kendo.MVC.dll assembly. Not quite sure what else to look at.

Added the following to the <head> tag in _Layout.cshtml:
     <link rel="stylesheet" href="@Url.Content("~/Content/kendo/kendo.common.min.css")">
     <link rel="stylesheet" href="@Url.Content("~/Content/kendo/kendo.silver.min.css")">
     <script src="@Url.Content("~/Scripts/jquery.min.js")"></script>
     <script src="@Url.Content("~/Scripts/kendo.web.min.js")"></script>
     <script src="@Url.Content("~/Scripts/kendo.aspnetmvc.min.js")"></script>

In the View (Index.cshtml) I have:
@(Html.Kendo().DatePicker().Name("Birthday")) 

The full error message is:

CS1061: 'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'Kendo' and no extension method 'Kendo'
accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive
or an assembly reference?)

0
Horizon Software
Top achievements
Rank 2
answered on 26 Jul 2012, 09:25 PM
So, I found what feels like a work-around to the error (but maybe it helps point to the actual fix?).
I discovered that if I add "@using Kendo.Mvc.UI" to the top of my View the helpers within that View will work. Nothing in the introduction talks about doing this so it feels like a bit of a hack (and having to add this to each View doesn't feel right either). I've tried adding this to _Layout but that doesn't help; it seems that it needs to be in the View in order to work.

Hopefully this will help get us closer to the problem and [real] solution.

Ken
0
Accepted
Horizon Software
Top achievements
Rank 2
answered on 26 Jul 2012, 09:48 PM
OK - mystery SOLVED!
My problem was that I wasn't paying close enough attention to the Introduction text re the web.config reference change. I added the namespace to the web.config at the root of the project not the one in the Views folder. Once I changed that I was able to remove the @using statement from my View and everything worked.

So, maybe a small suggestion for the Introduction is to add more emphasis as to which web.config should be edited (folks new to MVC like me will likely see "web.config" and just know which file they should edit...and be wrong).

0
Andrew
Top achievements
Rank 1
answered on 27 Jul 2012, 01:47 AM
Thanks Ken.

Do you by any chance know how to get the intelisense for this to work?
It fixed the error, but i still don't get intelisense.
0
Manuel
Top achievements
Rank 1
answered on 12 Sep 2012, 03:42 PM

The error message I get is different:

 

Microsoft JScript runtime error: Object doesn't support this property or method

 

Needless to say that I followed all the steps of the “Introduction” example. I use MVC 3 with Razor.

 

Suggestion will be appreciated.

UPDATE: Ok. I just resolved this issue. I made sure the java scripts were available when the 'datepicker' control runs. I did it by including the 'script' references of Kendo UI in the view headers.

0
Antariksh
Top achievements
Rank 1
answered on 25 Jul 2013, 11:40 AM
Hi,
I am facing below problem and i am using MVC 3.0 and following all steps ,add mvc.dll .
In the View (Index.cshtml) I have:
@(Html.Kendo().DatePicker().Name("Birthday"))


The full error message is:



CS1061: 'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'Kendo' and no extension method 'Kendo'

accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive

or an assembly reference?)
Please suggest me how to correct it
Thanks!!
0
antonio
Top achievements
Rank 1
answered on 04 Aug 2013, 05:20 AM
http://dotnetdevdude.com/Blog/CommentView,guid,9f136045-5d0e-441d-8c22-dff252e82271.aspx




Create a new ASP.NET MVC 3 or 4 projectAdd a reference to: [Kendo UI Directory]\Binaries\Mvc3\Kendo.Mvc.dllCopy the contents of [Kendo UI Directory]\Scripts to the Scripts folder of your MVC projectCopy the contents of [Kendo UI Directory]\Content to the Content folder of your MVC projectReference the Kendo UI scripts and and CSS files in your layout page.
*Note: If your using ASP.NET MVC 4 I suggest creating a bundler package

Add a reference to the Kendu.Mvc.UI namespace to the <namespaces> section of the web.config to allow your views to know about the Kendo HTML Helper extensions.


<add namespace="Kendo.Mvc.UI"/>
0
Venkatesh
Top achievements
Rank 1
answered on 26 Aug 2013, 09:27 AM
I added the following links in razor view
<link href="../../KendoStyles/kendo.common.min.css" rel="stylesheet" type="text/css" />
<link href="../../KendoStyles/kendo.default.min.css" rel="stylesheet" type="text/css" />

<script src="../../KendoScripts/jquery.min.js" type="text/javascript"></script>
 <script src="../../KendoScripts/kendo.web.min.js" type="text/javascript"></script>
  <script src="../../KendoScripts/kendo.aspnetmvc.min.js" type="text/javascript"></script>

I added an datepicker control.  Go the below error

Microsoft JScript runtime error: Unable to get value of the property 'extend': object is null or undefined in kendo.aspnetmvc.min.js file
when i added <script src="../../KendoScripts/kendo.all.min.js" type="text/javascript"></script> and removed  <script src="../../KendoScripts/kendo.web.min.js" type="text/javascript"></script> I works fine.
what's wrong with kendo.web.min.js



0
Sebastian
Telerik team
answered on 26 Aug 2013, 11:02 AM
Hello Venkatesh,

I tried to replicate the issue using the latest version 2013.2.716 of our Kendo UI Complete for ASP.NET MVC product but to no avail. I used your razor view definition you shared in a different forum thread in a quick test project which I am attaching to this forum post. No error was produced in my case and the date picker was visualized and functioned as expected.

Can you test that on your machine and compare the results? Any additional insight can help to pinpoint the cause of the abnormality to address it accordingly.

Regards,
Sebastian,
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Deej
Top achievements
Rank 1
answered on 08 Oct 2013, 05:09 PM
For anybody else having the same problem, it turns out that in addition to re-building the project after adding the namespace to the correct web.config, you must also close and re-open the file in question. Pretty frustrating if you don't already know.

http://stackoverflow.com/questions/14642709/asp-net-mvc-4-namespace-issue-in-razor-view
http://stackoverflow.com/questions/3875207/how-to-add-extra-namespaces-to-razor-pages-instead-of-using-declaration
http://stackoverflow.com/questions/3239006/how-to-import-a-namespace-in-razor-view-page
0
jon
Top achievements
Rank 1
answered on 05 May 2017, 07:18 AM

I got this problem in mvc 5.

Webconfig under /views contain
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Optimization"/>
        <add namespace="System.Web.Routing" />
        <add namespace="Kendo.Mvc.UI" />
      </namespaces>

View got @using Kendo.Mvc.UI at the top

Kendo.MVC ar in references but still this is a errormessage:

htmlhelper does not contain a definition for kendo

What to do?

0
Stefan
Telerik team
answered on 10 May 2017, 06:51 AM
Hello Jon,

Please ensure that the same namespace is added in the global Web.config file as well.

I can also suggest checking the article for the Visual studio integration and its sub-articles:

http://docs.telerik.com/aspnet-mvc/vs-integration/

If the issue still occurs, please send as a fully runnable example, reproducing the issue and I will gladly assist.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
0
Subhajit
Top achievements
Rank 1
answered on 09 Apr 2018, 04:22 AM
'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'Kendo' and no extension method 'Kendo' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?)This is the error massage, how can i solve it???
0
Stefan
Telerik team
answered on 09 Apr 2018, 07:26 AM
Hello, Subhajit,

The mentioned error can occur if the Kendo.MVC.DLL is not currently added to the application:

https://stackoverflow.com/questions/29520645/kendo-ui-reference-not-working-in-razor-view

Please ensure that all of the steps are followed by the following article:

https://docs.telerik.com/aspnet-mvc/getting-started/asp-net-mvc-5#add-reference-to-kendomvcdll

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Subhajit
Top achievements
Rank 1
answered on 10 Apr 2018, 04:59 AM

This is the error I am getting still now.Please tell me how to solve it?

 

0
Stefan
Telerik team
answered on 12 Apr 2018, 06:45 AM
Hello, Subhajit,

Based on the error I can assume that the TastViewModel does not implement the "IGanttTask" interface:

public class TaskViewModel : IGanttTask
    {

The same is valid for DependencyView model that has to implement "IGanttDependency":

public class DependencyViewModel : IGanttDependency
    {

I can suggest checking the runnable sample application where all of the files and their specifics can be observed for all demos:

https://docs.telerik.com/aspnet-mvc/introduction#sample-application

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
praveen123
Top achievements
Rank 1
answered on 10 Jun 2019, 04:35 AM
I have tried following the instructions.

But when i try to type in @(Html.Kendo()
kendo is not recognized.
'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'Kendo' and no extension method 'Kendo' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?
0
Viktor Tachev
Telerik team
answered on 12 Jun 2019, 01:20 PM
Hi,

The error you are seeing is observed when the Kendo assembly is not referenced in the project. Please make sure that a reference to Kendo.Mvc.dll is added to the project and the error should disappear. 

For a detailed instruction on referencing Kendo.Mvc.dll please follow the steps described in the article below:



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
Shah
Top achievements
Rank 1
answered on 10 Jun 2020, 11:09 AM
Finally, I fixed the issue when I added the namespace reference in the ~/Views/Web.config.
Tags
General Discussions
Asked by
Andrew
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Andrew
Top achievements
Rank 1
Horizon Software
Top achievements
Rank 2
Manuel
Top achievements
Rank 1
Antariksh
Top achievements
Rank 1
antonio
Top achievements
Rank 1
Venkatesh
Top achievements
Rank 1
Sebastian
Telerik team
Deej
Top achievements
Rank 1
jon
Top achievements
Rank 1
Stefan
Telerik team
Subhajit
Top achievements
Rank 1
praveen123
Top achievements
Rank 1
Viktor Tachev
Telerik team
Shah
Top achievements
Rank 1
Share this question
or