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
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
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?
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.
Atanas Korchev
the Telerik team
I have created a ticket and posted the project for you to have a look.
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?)
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
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).
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.
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.
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!!
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"/>
<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
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
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
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?
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
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
This is the error I am getting still now.Please tell me how to solve it?
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
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?
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