Questions tagged [viewengine]

262 questions
5
votes
3 answers

How do you write your own View engine for ASP.NET MVC?

I know that ASP.NET MVC will allow me to swap in various View engines that other people have created, but I am wondering how can I create my own View engine? More info: We have our own webforms based CMS and the main selling point about MVC is that…
Falkayn
  • 559
  • 3
  • 15
5
votes
2 answers

Search for view files in a custom location only for Specified Area in MVC 5

I'm looking to override the 'ViewEngine' for MVC5 in a way that first, it find my pages.. which already i failed. Second, It only operate on a single Area {root}/{area}/{controller}/{action}/{etc.} as so far as i googled it, i found several topic…
Hassan Faghihi
  • 1,888
  • 1
  • 37
  • 55
5
votes
4 answers

Use ASP.NET MVC as Email Template Engine: Good Idea?

Would it be a good idea, and executable, to use the ASP.NET MVC View Engine to render html to be sent out by email? I know it's possible to let the view render into a string. So that could be use to build the mail message. Since ASP.NET MVC is…
Bertvan
  • 4,943
  • 5
  • 40
  • 61
5
votes
1 answer

Has anyone been able or at least tried to port Liquid Template Language to C#?

I need to give end-users the ability to securely edit an asp.net mvc web application templates and so far Liquid Template Language seems to be perfect, but it is written in Ruby and porting it seems a too complex task for me as I don't know Ruby...…
MJ1686
  • 51
  • 4
5
votes
1 answer

Why is a full path to layout required in viewstart file when locations are specified in the view engine?

I am playing with the razor view engine and there's something I don't quite get. The _ViewStart file specifies a layout with the full file path like this: @{ Layout = "~/Views/Shared/_MasterLayout.cshtml"; } As I understand it, the full path…
Martin Hansen Lennox
  • 2,837
  • 2
  • 23
  • 64
5
votes
5 answers

What are the benefits of using an alternate view engine?

I am playing with ASP.NET MVC and I see that there are a few alternate view engines available for it such as NHaml and Spark. My question is why would you use an alternate view engine? I don't see a benefit to having something like this:
Wayne Molina
  • 19,158
  • 26
  • 98
  • 163
5
votes
4 answers

Is it worth migrating an existing asp.net-mvc project with webform view engine to razor?

I have a large asp.net-mvc web site . I recently upgraded to MVC 4 but one thing i am debating is it worth it to migrate to razor engine. I see there are tools to "auto" upgrade but i am trying to figure out if its worth the migration pain. I…
leora
  • 188,729
  • 360
  • 878
  • 1,366
5
votes
2 answers

ASP.NET MVC: Multiple View Folders and _ViewStart.cshtml file

I have an MVC project that requires there to be 2 different View folders. One is at ~/Views/ and one at ~/Framework/Views/. This is done by creating a custom view engine based on the razor view engine like this: public class MyViewEngine :…
hofnarwillie
  • 3,563
  • 10
  • 49
  • 73
5
votes
4 answers

Failover to an alternate View when Partial View is not found?

I have an MVC app that uses dynamic business objects that are inherited from a parent object type. For example the base class Client might have two sub classes called Vendor and ServiceProvider, and these are all handled by the same controller. I…
Nick Albrecht
  • 16,607
  • 10
  • 66
  • 101
4
votes
1 answer

How do I use handlebar.js templates as rails view engine?

I'd like to add handlebar.js as a view engine in my rails app. I'm trying to share the same templates for both the server and client. I've found a few gem's already (handlebar_assets and handlebar-rails), but they seem to focus only on client side…
Dane O'Connor
  • 75,180
  • 37
  • 119
  • 173
4
votes
1 answer

Using Spark or Razor viewengine with OpenRasta

has anyone used Spark or Razor view engine with OpenRasta framework? or any suggestion on the view engine other than the build in WebForms ?
Eatdoku
  • 6,569
  • 13
  • 63
  • 98
4
votes
2 answers

View Engines for Web Matrix Web Pages

Microsoft has a new website editing tool: WebMatrix. WebMatrix uses the new Web Pages engine in which Razor is the view engine; Razor is also the new view engine for MVC3. I am attempting to find out if it is possible to register and use a different…
jr.
  • 1,797
  • 2
  • 15
  • 18
4
votes
5 answers

HTML Email created with ASP.NET MVC 2 View (standard view engine)

Is there a way to email an ASP.NET View using the standard view engine (not spark)?
Brian David Berman
  • 7,514
  • 26
  • 77
  • 144
4
votes
1 answer

A XAML based View Engine for ASP.NET MVC

As ASP.NET MVC has a pluggable view engine architecture, and XAML is an object descriptive mark-up that, given the right processor/ parser, can generate an appropriate UI...are there plans/ efforts to create a view engine that can turn XAML into…
Kieron
  • 26,748
  • 16
  • 78
  • 122
4
votes
6 answers

Is there an ASP.Net MVC view engine that supports JavaScript views?

I would like to generate some JavaScript on the server side in ASP.Net MVC. Is there a view engine that supports this? Ideally I would like to be able to get JavaScript from an url like: http://myapp/controller/action.js I've looked at the…
Jacob
  • 22,785
  • 8
  • 39
  • 55