Questions tagged [viewengine]
262 questions
0
votes
1 answer
How can I get MVC 5 to render a View that is physically outside the Web Application Folder?
I am using ASP.NET MVC5 and I would like to render a view from a folder that is outside the application folder. I tried registering my own custom the VirtualPathProvider and I even created my own VirtualPathProviderViewEngine to support rendering…

abraganza
- 135
- 2
- 9
0
votes
1 answer
ViewEngine's location search order is ok but renders the view from wrong folder
I have a nopCommerce plugin which has a custom view engine as following:
CustomViewEngine : ThemeableRazorViewEngine
The plugin has a view file called CategoryNavigation.cshtml which also exists at Views\Catalog\CategoryNavigation.cshtml
Now if I…

Rahatur
- 3,147
- 3
- 33
- 49
0
votes
0 answers
Handlebars - Using Partial View
I am new in Express.JS and Handlebars.JS and trying to build an app on "express": "~4.14.0" and "hbs": "~4.0.0".
I was familiar with Laravel Blade as a template engine.
There are some features like-
Extending A Layout
Add Section in a…

Abrar Jahin
- 13,970
- 24
- 112
- 161
0
votes
1 answer
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final" Custom View Engine
I'm on "Microsoft.AspNet.Mvc": "6.0.0-rc1-final" and
I don't see the configure method on AddMvc any longer and AddViewOptions.ViewEngine will throw
services.AddMvc().AddViewOptions(o =>
{
…

Sen Gupta
- 11
- 1
0
votes
1 answer
How to get Html of any view by it's full file location
public string GetRazorViewAsString(string filePath, object model = null)
{
var resultString = new StringWriter();
var context = new HttpContextWrapper(HttpContext.Current);
var routeData = new RouteData();
//…

Srinivas M
- 303
- 1
- 3
- 12
0
votes
1 answer
Can we recursively search sub folders when looking for a view in Asp.Net MVC 4
I know that I can can add search locations to a View Engine as explained in this answer.
I was just wondering is there any way to tell the view engine to then recursively search sub folders without having to specify the entire path?
E.g. if I had a…

davy
- 4,474
- 10
- 48
- 71
0
votes
2 answers
Custom tokens in view engine?
In ASP.NET MVC 2 project, how might I go about writing a custom view engine that allows custom tokens to be used when searching for views?
Specifically, I'm trying to achieve this:
In PagesController:
public ActionResult ViewPage(string folder,…

Brian Vallelunga
- 9,869
- 15
- 60
- 87
0
votes
2 answers
EJS render no output
I am trying to use EJS but whenever res.render is called, it just hangs there with no response.
This is my app.js file
var express = require('express');
var bodyParser = require('body-parser')
var mongoose = require('mongoose');
var app =…

Exceptions
- 1,174
- 2
- 9
- 28
0
votes
1 answer
NodeJs with Express and Handlebars - handlebars.engine is undefined
I am following the tutorials in O'Reilly's "Web Development with Node & Express" by Ethan Brown.
They use handlebars as the view engine.
Here is my code:
var express = require ('express'),
handlebars = require('express3-handlebars'),
app =…

Asher
- 393
- 3
- 16
0
votes
1 answer
Spark can't find my template
I'm trying to convert from Razor to Spark.
Here is my controller:
public class HomeController : Controller
{
public ActionResult Index()
{
return View("~/Views/Account/Index");
}
}
But Spark gives the…

Ian Warburton
- 15,170
- 23
- 107
- 189
0
votes
2 answers
Vash view engine gives always an error when rendering using nodejs & express 3
I'm using the view engine vash with nodejs & express 3 and my index.vash and layout are looking as follows:
// index.vash
@html.extend('layout', function(model){
@html.block('body', function(model){
Welcome
…

Luca Steeb
- 1,795
- 4
- 23
- 44
0
votes
1 answer
Dynamic Views based on view models
I have an asp.net mvc 2 app. I need to display the same page to each user. But each user has different rights to the data. IE some can see but not edit some data, some cannot edit nor see the data. Ideally data that cannot be seen nor edited is…

Joe
- 721
- 9
- 22
0
votes
1 answer
Custom and Razor view engine mess while combining the two
I have a asp.net web api application that also renders some razor pages.
By default, there are two default engines(webform\razor) and I had no problems rendering my razor pages.
Now I need to support some old aspx\ascx pages that are rendered using…

Amir Popovich
- 29,350
- 9
- 53
- 99
0
votes
1 answer
Super Simple View Engine (SSVE) @Context.ViewBag depth
Is it possible to dive deep into objects stored in the ViewBag when using SSVE?
I have a "User" object placed on the ViewBag as such:
context.ViewBag.User = new { UserName = userByCookie.UserName };
When I try to access the UserName property from…

detroitpro
- 3,853
- 4
- 35
- 64
0
votes
1 answer
Output Cache problem on ViewEngine that use 2 separate view for 1 controller
http://www.hanselman.com/blog/MixMobileWebSitesWithASPNETMVCAndTheMobileBrowserDefinitionFile.aspx
To the sake of simplicity, please try out this. Basically, I am trying to do the mobile view engine, but then i found out that I have outputcache,…

DucDigital
- 4,580
- 9
- 49
- 97