Top "Razor" questions

Razor is a template language used by ASP.

Handling onchange event in HTML.DropDownList Razor MVC

I'm handling an onchange event with a selected value by simple HTML like this: <select onchange="location = this.value;"&…

asp.net-mvc asp.net-mvc-3 razor html-helper
ASP.NET MVC Razor: How to render a Razor Partial View's HTML inside the controller action

How to generate a HTML of a given partial view on ASP.NET view engine is known. But if this …

c# asp.net-mvc razor
Render partial view with dynamic model in Razor view engine and ASP.NET MVC 3

When I try to render a partial view whose model type is specified as: @model dynamic by using the following …

asp.net-mvc razor asp.net-mvc-3
Razor HtmlHelper Extensions (or other namespaces for views) Not Found

Dunno if this was happening in the PR or Beta, but if I create an extension method on HtmlHelper, it …

asp.net-mvc-3 extension-methods razor html-helper
Conditional HTML Attributes using Razor MVC3

The variable strCSSClass often has a value but sometimes is empty. I do not want to include an empty class="" …

html asp.net-mvc-3 razor
Runtime error: Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.0.0.0

I tinkered with my ASP.NET MVC4 packages via NuGet, and now System.Web.WebPages.Razor v3 won't load. Sometimes …

c# asp.net-mvc-4 razor runtime-error
How can I use a reportviewer control in an asp.net mvc 3 razor view?

I'm trying to use a reportviewer control, within a razor view, in the mvc 3 framework. The online documentation talks of …

asp.net-mvc-3 razor reportviewer
Display encoded html with razor

I store encoded HTML in the database. The only way i could display it correctly is : <div class='content'&…

asp.net-mvc-3 razor html-encode
ASP.NET MVC Razor render without encoding

Razor encodes string by default. Is there any special syntax for rendering without encoding?

c# .net asp.net asp.net-mvc razor
Current date and time - Default in MVC razor

When the MVC view page with this textbox, loads , I would like to display current date and time by default. …

asp.net-mvc asp.net-mvc-3 asp.net-mvc-2 razor html-helper