Top "Razor" questions

Razor is a template language used by ASP.

Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0

I just upgraded packages in an MVC 3 project (ASP.net 4), and now I am getting the following error message when …

asp.net-mvc-3 razor dependencies asp.net-4.0
how to add script src inside a View when using Layout

I want to include a javascript reference like: <script src="@Url.Content("~/Scripts/jqueryFoo.js")" type="text/javascript">&…

asp.net-mvc razor
Mix Razor and Javascript code

I'm pretty confused with how to mix razor and js. This is the current function I am stuck with: <…

c# javascript razor
error CS0103: The name ' ' does not exist in the current context

When my view loads, I need to check which domain the user is visiting, and based on the result, reference …

c# asp.net-mvc razor codeblocks
How to use ternary operator in razor (specifically on HTML attributes)?

With the WebForms view engine, I'll commonly use the ternary operator for very simple conditionals, especially within HTML attributes. For …

razor asp.net-mvc-3
ASP.Net MVC – Resource Cannot be found error

I am completely new to ASP.Net MVC. I just created an MVC3 project in Visual Studio 2010. The view engine …

asp.net asp.net-mvc asp.net-mvc-3 razor
MVC 4 @Scripts "does not exist"

I have just created an ASP.NET MVC 4 project and used Visual Studio 2012 RC to create a Controller and Razor …

asp.net-mvc razor
Razor View throwing "The name 'model' does not exist in the current context"

After significant refactoring in my MVC 4 application, and Razor shows this error while debugging Views: The name 'model' does not …

asp.net-mvc asp.net-mvc-4 razor
Styles.Render in MVC4

In a .NET MVC4 project how does @Styles.Render works? I mean, in @Styles.Render("~/Content/css") which file is …

c# asp.net-mvc razor asp.net-mvc-4
Html.Textbox VS Html.TextboxFor

What is the difference between Html.Textbox and Html.TextboxFor?

asp.net-mvc asp.net-mvc-3 razor