Developer forum

Forum » Development » Razor and IntelliSense

Razor and IntelliSense

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi guys,

I found the following in the 9.4 release notes:

  • Support helper namespaces from includes vs compatibility 
    Platform\Templates\Razor 
    Support for App_Code includes have been added to intellisense in visual studio

Can you elaborate on what that means and what we need to do to take advantage of it?

Thanks!


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
This post has been marked as an answer

Hi Imar,

Documentation for that is currently missing. I'll ask someone to look into it.

In the meantime you can read more about the added features in this thread: https://doc.dynamicweb.com/forum/templates/templates/razor-partial-views-and-helper-functions

/Morten

 

 

Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Great, thanks Morten!

 
Nicolai Pedersen
Reply

Hi Imar

This is what the docs written by the developer (that was me) says on the TFS item:

  1. Create VS project with MVC support (i.e. use Rapido)
  2. In the root of the project, create a app_code folder
  3. Add a cshtml file with helpers, see attachment
  4. In a layout or master file (or any other razor template) add this statement @Include("../../../App_Code/MyCustomHelpers.cshtml", "MyCustomHelpers")
  5. Check that the helpers will be seen by intellisense in vs and executed on the server by doing like this:
  6. @MyCustomHelpers.HelperName("asdf")
  7.  @MyCustomHelpers.something()

I do remember that it was a problem to get this to work - but I think this fixed it...

BR Nicolai

 

You must be logged in to post in the forum