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

'System.Web.Mvc.HtmlHelper<object>' does not contain a definition for 'Telerik'

1 Answer 481 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mike
Top achievements
Rank 1
Mike asked on 04 Apr 2010, 11:25 PM
I have converted a Web Forms solution to a MVC/Web Forms solution. I am trying to use Telerik inside of it and I keep getting this error:

'System.Web.Mvc.HtmlHelper<object>' does not contain a definition for 'Telerik'

Server Error in '/Platform' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0117: 'System.Web.Mvc.HtmlHelper<object>' does not contain a definition for 'Telerik'

Source Error:

Line 9:  <body>
Line 10:     <div>
Line 11: <%= Html.Telerik().ScriptRegistrar() %>
Line 12:         
Line 13:     </div>

I have converted a simpler application to try and see if I could get it to work and it worked fine. This particular solution is multiple modules that get copied into the main module at build time. Is there something that I need to know to get the module to recognize the Telerik extensions? I have Views folders in every Web module and configs to go with those. The Telerik.Web.Mvc dll is referenced in all web modules. The namespace is in every web config.

Any information will be helpful. Thanks in advance.



1 Answer, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 05 Apr 2010, 03:23 AM
Figured it out after trying other, non-Telerik helpers. Needed to tell it to compile the pages as 3.5, this needed to be added in the web config file:

  <system.codedom> 
    <compilers> 
      <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        <providerOption name="CompilerVersion" value="v3.5"/> 
        <providerOption name="WarnAsError" value="false"/> 
      </compiler> 
    </compilers> 
  </system.codedom> 





Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
Share this question
or