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

[Solved] How do I start unsing the Open Source Version of MVC2 Telerik controls?

3 Answers 61 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Toby
Top achievements
Rank 1
Toby asked on 18 Oct 2010, 10:53 AM
Hello,
I have just started my journey on MVC.  First thing I noticed when designing the Views was has much the same look like as the ASP of old with code inter mixed with UI.  Coming from a Web Forms I saw this a lacking.  Nonetheless I am new and see huge benefits in other areas of MVC, one being unit testing.  I have now looked into using the Telerik controls, I thought it would be as simple as reference the telerik.web.mvc.dll in my project and the extensions would appear. Sadly not.  i.e Html.Telerik...  How do I get this working in my own project?

3 Answers, 1 is accepted

Sort by
0
Toby
Top achievements
Rank 1
answered on 18 Oct 2010, 10:59 AM
Sorry maybe I should read Installation Instructions. :-/
0
Toby
Top achievements
Rank 1
answered on 19 Oct 2010, 03:14 AM
I speak to soon.  In the demo it mentions to add the
<namespaces>
     <add namespace="Telerik.Web.Mvc.UI" />
</namespaces>

in the webconfig file. I am using MVC 2 and my webconfig does not have this format

It has

 

<configuration>
  <system.web>
    <httpHandlers>
      <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
    </httpHandlers>

    <!--
        Enabling request validation in view pages would cause validation to occur
        after the input has already been processed by the controller. By default
        MVC performs request validation before a controller processes the input.
        To change this behavior apply the ValidateInputAttribute to a
        controller or action.
    -->
    <pages
        validateRequest="false"
        pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <controls>
        <add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
      </controls>
     
    </pages>
  </system.web>

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
   
    <handlers>
      <remove name="BlockViewHandler"/>
      <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
    </handlers>
  </system.webServer>
</configuration>



So where do I put this name space?
0
Mateus
Top achievements
Rank 1
answered on 18 Jan 2011, 12:49 PM
Hello,

There is only one syntax for web.config. Here is a link to where the namespace tag needs to be placed: http://msdn.microsoft.com/en-us/library/ms164642.aspx. Also, for future reference, see http://msdn.microsoft.com/en-us/library/dayb112d.aspx for the system.web tag.

It would look something like this:

<configuration>
  <system.web>
    <namespaces>
      <add namespace="Telerik.Web.Mvc.UI" />
    </namespaces>
 
    <httpHandlers>
      <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
    </httpHandlers>
.
.
.
  </system.webServer>
</configuration>

Hope this helps!
Tags
General Discussions
Asked by
Toby
Top achievements
Rank 1
Answers by
Toby
Top achievements
Rank 1
Mateus
Top achievements
Rank 1
Share this question
or