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

[Solved] Intellisense and Possible Installation Issues

2 Answers 103 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.
David
Top achievements
Rank 1
David asked on 08 Sep 2011, 03:46 PM
Hi,

We have recently added the MVC extensions to an MVC 3 project at work. So, the project was not created using the Telerik MVC 3 template. The extensions were added after the fact. We added them using Nuget.
The only way we can get intellisense for the extensions is if we place @using(@Html.Telerik ) ... (going from memory there).

Anyhow, I have never had to include a @using statement in my other Telerik MVC projects and there does not seem to be anything in the doco to suggest that @using would be required.

So my question is, what have we done wrong such that our project requires this @using statement to use the Telerik extensions?

Cheers

2 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 09 Sep 2011, 08:12 AM
Hello David,

 Intellisense needs the namespaces to be imported. In most cases this can be done globally from web.config. For razor you should add this to your web.config:

<system.web.webPages.razor>
<pages pageBaseType="System.Web.Mvc.WebViewPage">
    <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
 
        <add namespace="Telerik.Web.Mvc.UI" />
    </namespaces>
</pages>
</system.web.webPages.razor>


You can find additional info in the Razor help topic.

Regards,

Atanas Korchev
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
David
Top achievements
Rank 1
answered on 10 Sep 2011, 11:39 AM
Thanks very much for that.
We did have the namespaces, but we did not have the element <system.web.webPages.razor>. We missed the forest for the trees on that one.

Thanks again. Much appreciated!
Tags
General Discussions
Asked by
David
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
David
Top achievements
Rank 1
Share this question
or