Name Space Conflict with the MVC Extensions

8 posts, 0 answers
  1. hn
    hn avatar
    1 posts
    Member since:
    Mar 2007

    Posted 12 Jul 2012 Link to this post

    We have just downloaded the latest July release of Kndo wrappers for MVC . We are trying to test them side by side with the MVC extensions however we get the following error when building the project after adding reference to the Kendo dll

    'SliderTickPlacement' is an ambiguous reference between 'Telerik.Web.Mvc.UI.SliderTickPlacement' and 'Kendo.Mvc.UI.SliderTickPlacement'

    You do say that it is possible to use  Kendo  within the same project. Would appreciate clarification.
    Many thanks
  2. Vesselin Obreshkov
    Vesselin Obreshkov avatar
    81 posts
    Member since:
    Jan 2010

    Posted 12 Jul 2012 Link to this post

    We have had similar issues trying to use Kendo for ASP.NET MVC and Telerik MVC extensions together. There's a few namespace conflicts so you either need to namespace all enumerations and other things that are conflicting or just migrate to Kendo. Most helpers are almost direct replacement for the Telerik Extensions, most grids need minimal changes other than DataBinding() <=> DataSource() and ClientEvents <=> Events for the most part. It took us less than 2 weeks to migrate our whole dashboard from Telerik MVC to Kendo and we use quite a few widgets from Grids to Splitters.

    What they mean by using Kendo with the Telerik Extensions is using the traditional JavaScript approach with using Kendo UI. Kendo for ASP.NET MVC doesn't work well with the Telerik Extensions.
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 12 Jul 2012 Link to this post

    Hello,

     All you need to do is just fully qualify the enum name:

    TickPlacement(Kendo.Mvc.UI.SliderTickPlacement.Both)

     
    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!
  5. hn
    hn avatar
    1 posts
    Member since:
    Mar 2007

    Posted 12 Jul 2012 Link to this post

    Thanks for your reply.
    Does this mean we have to fully qualify all code for both Kendo AND the extensionS ?
  6. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 13 Jul 2012 Link to this post

    Hi,

     Of course not. You only need to fully qualify the enums.

    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!
  7. hn
    hn avatar
    1 posts
    Member since:
    Mar 2007

    Posted 16 Jul 2012 Link to this post

    So you mean - Of course yes. That is exactly what I meant. i.e we have to hunt around in our exisitng project and change all enums to be fully qualified while also fully qualifying the Kendo code. right?
  8. Bill
    Bill avatar
    20 posts
    Member since:
    Oct 2011

    Posted 24 Oct 2012 Link to this post

    SOLUTION - For those of us with large apps to convert from Telerik to KendoUI, you can avoid fully qualifying all of your enums by placing a webconfig directly in each view folder as you migrate that folder. Below is the complete webconfig I have in one of my View folders.  All it does is clear out the namespaces, i.e. the Telerik.Web.MVC.UI sitting in at the root of "Views", and add the ones I want back.  When you've finished migrating, you can remove all of these webconfigs and alter the webconfig at the root of Views or your app, depending on whether you're razor or webforms.  This works for MVC3, for MVC4 you should examine your current webconfig.

    <?xml version="1.0"?>

    <configuration>
      <system.web.webPages.razor>
        <pages pageBaseType="System.Web.Mvc.WebViewPage">
          <namespaces>
            <clear/>
            <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>
        </pages>
      </system.web.webPages.razor>
    </configuration>
  9. Ed
    Ed avatar
    2 posts
    Member since:
    Aug 2012

    Posted 25 Jul 2014 in reply to Bill Link to this post

    Bill,

    Thanks for pointing out the use of the individual web.config files in the Views folders. It saved me a ton of work. :-)

    --Ed
Back to Top
UI for ASP.NET MVC is VS 2017 Ready