Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get IntelliSense for Razor View Engine

Tags:

Just installed Microsoft Visual Web Developer 2010 and trying to create an MVC application with Razor View Engine.

When opened a ".cshtml" file, I am not able to get colors for syntaxes in editor and also intellisense is not appearing. Is there any option I explicitly need to enable it?

like image 729
max Avatar asked Aug 16 '10 07:08

max


People also ask

How do you add a view on razor?

Right click the Views\HelloWorld folder and click Add, then click MVC 5 View Page with Layout (Razor). In the Specify Name for Item dialog box, enter Index, and then click OK. In the Select a Layout Page dialog, accept the default _Layout. cshtml and click OK.

How do you use a model in razor view?

Right-click in the Store Index action method and select Add View as before, select Genre as the Model class, and press the Add button. This tells the Razor view engine that it will be working with a model object that can hold several Genre objects.

What is the Razor view engine in asp net?

Razor View Engine is a markup syntax which helps us to write HTML and server-side code in web pages using C# or VB.Net. It is server-side markup language however it is not at all a programming language.


1 Answers

UPDATE: The Release Candidate finally supports Razor IntelliSense.
Update2: The final release got announced here and it also still supports Intellisense for Razor syntax. Woohoo!

Here's a screenshot of the new enhanced Intellisense and Razor syntax highlighting:

For a great overview/introduction to MVC3 and NuGet I suggest you take a look at this PDC10 video.

Previous Answer

No. It doesn't work yet with the current beta:

Razor intellisense isn't in today's beta. We needed to do a little more testing (and bug fixing) before we were ready to distribute it broadly. It patches a few VS files and so we need to make sure it is 100% solid before giving it out broadly.

It will definitely be in the final release, though, and should be available for people to install in the next few weeks.

Thanks,

Scott

Taken from http://weblogs.asp.net/scottgu/archive/2010/10/06/announcing-nupack-asp-net-mvc-3-beta-and-webmatrix-beta-2.aspx#7624491

like image 128
Kris van der Mast Avatar answered Sep 22 '22 17:09

Kris van der Mast