Questions tagged [viewengine]
262 questions
15
votes
2 answers
How to write a Visual Studio extension for a template or markup language that supports embedded code snippets
Is it possible to write an extension for Visual Studio 2010 that provides syntax highlighting, intellisense, outlining, etc for a custom template or markup language supporting embedded code snippets, similar to the tooling for Razor in ASP .NET MVC…

Stephan Tolksdorf
- 3,062
- 21
- 28
13
votes
4 answers
Razor vs Webforms view engine for new ASP.NET MVC 3 site
Razor is prettier (and is new therefore cool).
Webforms is something I am already familiar with.
Naturally I would unquestionably go for the new thing to learn - Razor. But I have heard of two disadvantages that worry me:
can't easily reuse…

BritishDeveloper
- 13,219
- 9
- 52
- 62
12
votes
6 answers
ASP.NET how to resolve CS1513: } expected error on page
I am getting an error at run time when viewing my ASP.NET page in the browser. I am not getting any build errors however I am getting the following compiler error at runtime:
Compilation Error
Description: An error occurred during the compilation of…

Tiger
- 417
- 2
- 8
- 23
12
votes
3 answers
Handling Layout properties with custom Razor view engine
I have implemented a multi-tenant view engine similar to what is described here:
http://weblogs.asp.net/imranbaloch/archive/2011/06/27/view-engine-with-dynamic-view-location.aspx
Which let me override the search locations for view like this:
…

Sparafusile
- 4,696
- 7
- 34
- 57
11
votes
3 answers
Razor Generator: how to use view compiled in a library as the partial view for master defined in main mvc project
We have an ASP.NET MVC 4 application with around 3000 views in it. We've decided to split this set of views into separated DLLs and compile it with RazorGenerator. We keep only main _Layout.cshtml and related files in the main MVC project.
We cannot…

tomash
- 687
- 1
- 6
- 17
11
votes
4 answers
What are the benefits of using an alternate ASP.NET MVC view engine?
I have looked at the usual suspects...Spark, NHaml, etc. They all seem to be syntactic sugar for those that are uncomfortable with the <% %> syntax. Are there any other tangible benefits? Syntactic sugar doesn't seem to me to be a sufficient…

Robert Harvey
- 178,213
- 47
- 333
- 501
10
votes
2 answers
ASP.NET MVC View Engine Resolution Sequence
I created a simple ASP.NET MVC version 1.0 application. I have a ProductController which has one action Index. In the view, I created a corresponding Index.aspx under Product subfolder.
Then I referenced the Spark dll and created Index.spark under…

intangible02
- 993
- 1
- 9
- 19
9
votes
4 answers
Unit testing MVC3 Razor helpers/views without strings
I am trying out the MVC3 Razor view engine, and one the features that I am exploring is the ability to unit test views.
I have seen a number of examples where Razor views can be compiled into an assembly and rendered into a string. The problem is…

Erick T
- 7,009
- 9
- 50
- 85
9
votes
1 answer
Extending Razor View Engine to Handle Rendering
I wonder if there is any way to extend razor view engine capabilities to handle some custom text/tag and parse/proceed before render. Assume that I use some special tag which is ${} as below:
${some word}
Then, I want to parse the…

Halil Ibrahim
- 1,339
- 1
- 20
- 39
9
votes
2 answers
Are there any view engines for ASP MVC that are 'designable'?
Here's my problem:
I am disturbed by the "impedance mismatch" between what graphic/web designers actually produce, and what is needed by the standard ASP MVC view engine.
Basically there is no way to visually design a view i.e. the output of an…

Jack Ukleja
- 13,061
- 11
- 72
- 113
8
votes
2 answers
Example of Node.js Express registering Underscore.js as view engine?
Underscore.js does not have a compile function like ejs and jade, but does work as a Node.js module. Would someone please provide an example of how to make it work inside an Express app?

Jamie
- 507
- 4
- 8
8
votes
4 answers
installing the razor view engine for Visual Studio
I just downloaded and installed Web Matrix beta.
I am really liking the razor view engine.
Not so much the Web Matrix IDE.
Is there any way to install razor view engine for use in the Visual Studio without installing WebMatrix?

Kenneth J
- 4,846
- 11
- 39
- 56
7
votes
2 answers
How does MVC3 picks which ViewEngine to use if I have multiple engines in ViewEngines collection?
I have a custom view engine developed internally. In the same project, I would like to use Razor for some pages and my custom engine for some pages. How does MVC framework choose which engine to use? BTW, my custom engine does not require any…

Charasala
- 141
- 11
7
votes
1 answer
.NET MVC Custom viewengine layout
In a custom viewengine in the FindView method, how can I see the Layout used? masterName is always empty.
ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache) {
// How do I get…

jaap
- 373
- 6
- 15
7
votes
3 answers
Does Razor ViewEngine cache the rendered HTMLs?
I have a 2-level menu item: I have a list of department and each department has a list of stores.
I have a Menu, PartialView which iterates through the Model (departments) and builds the menu:
@model IEnumerable
-
@foreach (var…

Hooman Bahreini
- 14,480
- 11
- 70
- 137