Top "Razor" questions

Razor is a template language used by ASP.

MVC Razor view nested foreach's model

Imagine a common scenario, this is a simpler version of what I'm coming across. I actually have a couple of …

c# asp.net asp.net-mvc-3 view razor
Razor-based view doesn't see referenced assemblies

I'm attempting to create a strongly-typed view based on a class from another assembly. For whatever reason though, my Razor …

asp.net-mvc asp.net-mvc-3 razor
How do I specify the columns and rows of a multiline Editor-For in ASP.MVC?

In ASP.MVC 3, how do I specify the columns and rows for a multiline EditorFor (textarea)? I am using [UIHint("…

asp.net-mvc razor data-annotations
Checkbox for nullable boolean

My model has a boolean that has to be nullable public bool? Foo { get; set; } so in my Razor cshtml …

asp.net-mvc-3 razor nullable
Concatenating strings in Razor

How would I join two strings in Razor syntax? If I had: @Model.address and @Model.city and I wanted …

asp.net-mvc asp.net-mvc-3 razor
How to use ? : if statements with Razor and inline code blocks

I'm updating my old .aspx views with the new Razore view engine. I have a bunch of places where I …

asp.net asp.net-mvc asp.net-mvc-3 syntax razor
how to set id to Html.TextBox item on MVC

Im trying to catch the textbox element by javascript, in order to put text into it. so how to set …

javascript asp.net-mvc razor textbox html.textbox
How to add a script in a partial view in MVC4?

This is the code which I have in my partial view @model Contoso.MvcApplication.Models.Exercises.AbsoluteArithmetic @using(Html.BeginForm()) { &…

asp.net asp.net-mvc razor asp.net-mvc-4 razor-2
The name 'ViewBag' does not exist in the current context - Visual Studio 2015

I'm starting to develop in ASP.NET again and I ran into a small error within Visual Studio. My .cshtml …

c# asp.net-mvc visual-studio razor web-config