Top "Razor-2" questions

Razor 2 is an upgrade of a template language used by ASP.

Html.DropDownList default selected item

I am displaying a list of dropDownLists inside a ForEach loop. This is the code @foreach (var task in Model.…

razor html-select razor-2
ASP.NET MVC 4 Script bundling causes errors upon deployment

My website is working fine on localhost when @Scripts.Render() is not bundling the scripts however when I deploy to …

c# javascript asp.net-mvc-4 bundle razor-2
How to add custom data attributes and classes to `@Html.EditorFor`?

I want to add some custom attributes to the input generated by @Html.EditorFor, I tried the following: @Html.EditorFor(…

asp.net-mvc asp.net-mvc-4 html-helper razor-2
Addition of two numbers in MVC

I am trying to add two numbers in MVC. My requirement is "I have 2 text boxes in View from which …

asp.net asp.net-mvc asp.net-mvc-4 razor-2
difference in input type=Checkbox, @HTML.CheckBox and @HTML.CheckBoxFor?

I m new to MVC and confused what is difference in <Input type="Checkbox">, @HTML.CheckBox and @HTML.…

asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 razor razor-2
MVC4 Razor difference in @model and @inherit in view header?

To make a view strongly typed we can use @model and @inherit. Can you please tell me what the difference …

c# .net asp.net-mvc-3 asp.net-mvc-4 razor-2
how to get the value of a HiddenFor control in jquery

i have a hidden for control as @Html.HiddenFor(m => m.SchedulingProfileDetails.Id) I am trying to access the …

javascript jquery asp.net-mvc-3 razor-2
MVC4 Azure Publishing Error - Could not load file or assembly 'System.Web.Razor'

The project runs fine locally, its only when published I get the following error: Could not load file or assembly …

azure asp.net-mvc-4 razor-2 fusion
Error 22 The "EnsureBindingRedirects" task could not be loaded from the assembly

I cloned a project with vs 2013. When I run it I get this error. Error 1 The "EnsureBindingRedirects" task could not …

c# asp.net-mvc-4 razor-2
Visual Studio 2015 Razor View MVC Types not recognized

I installed Visual Studio 2015 and rebooted. The "MVC" types are not recognized in 2015 but are still recognized in 2013. This is …

asp.net-mvc visual-studio-2015 razor-2