Kendo UI and MVC Starting a new project

15 posts, 1 answers
  1. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 16 Jul 2012 Link to this post

    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.
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 16 Jul 2012 Link to this post

    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!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 25 Jul 2012 Link to this post

    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?
  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 26 Jul 2012 Link to this post

    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!
  6. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 26 Jul 2012 Link to this post

    Hi Atanas,

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

  7. Horizon Software
    Horizon Software avatar
    1 posts
    Member since:
    Dec 2009

    Posted 26 Jul 2012 Link to this post

    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?)

  8. Horizon Software
    Horizon Software avatar
    1 posts
    Member since:
    Dec 2009

    Posted 26 Jul 2012 Link to this post

    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
  9. Answer
    Horizon Software
    Horizon Software avatar
    1 posts
    Member since:
    Dec 2009

    Posted 26 Jul 2012 Link to this post

    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).

  10. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 26 Jul 2012 Link to this post

    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.
  11. Manuel
    Manuel avatar
    1 posts
    Member since:
    Sep 2012

    Posted 12 Sep 2012 Link to this post

    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.

  12. Antariksh
    Antariksh avatar
    1 posts
    Member since:
    Jul 2013

    Posted 25 Jul 2013 Link to this post

    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!!
  13. antonio
    antonio avatar
    1 posts
    Member since:
    Aug 2013

    Posted 04 Aug 2013 Link to this post

    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"/>
  14. Venkatesh
    Venkatesh avatar
    4 posts
    Member since:
    May 2013

    Posted 26 Aug 2013 Link to this post

    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



  15. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 26 Aug 2013 Link to this post

    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!
  16. Deej
    Deej avatar
    14 posts
    Member since:
    Oct 2013

    Posted 08 Oct 2013 Link to this post

    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
Back to Top
UI for ASP.NET MVC is VS 2017 Ready