Questions tagged [viewengine]

262 questions
7
votes
1 answer

ASP.NET MVC3 Razor - lost intellisense when placing view in alternate location?

VS2010 Ultimate, ASP.NET MVC 3 w/Razor. I've created a custom view engine in my MVC3 app that allows nested areas, like so ~/areas/admin /marketing /views index /controllers marketingController …
3Dave
  • 28,657
  • 18
  • 88
  • 151
7
votes
5 answers

Is there a way to make a @section optional with the asp.net mvc Razor ViewEngine?

I have a Page.cshtml similar to the following (that does not work): @{ Layout = "../Shared/Layouts/_Layout.cshtml"; var mycollection = (ViewBag.TheCollection as IQueryable); }

@ViewBag.Title

content here @if…
John Boker
  • 82,559
  • 17
  • 97
  • 130
7
votes
3 answers

What are few advantages of Razor view engine over other view engines

I want to know what are few advantages of Razor view engine other then its syntax over other view engines like Spark, NHaml or default aspx view engine. Also what is the performance difference between them
Fraz Sundal
  • 10,288
  • 22
  • 81
  • 132
7
votes
4 answers

How to Download Razor View Engine

I want to download and install razor view engine for ASP.Net MVC 2. From where i can download and install?
Fraz Sundal
  • 10,288
  • 22
  • 81
  • 132
7
votes
2 answers

Mixing spark and webform view engines

Is it possible to use multiple view engines? I have a large(ish) site that is already using the webforms view engine, but we would like to move to spark for new features. Is this supported? any documentation online that details how to do this?
Joel Martinez
  • 46,929
  • 26
  • 130
  • 185
7
votes
2 answers

Render partial view to string MVC4

I am using the following to render a partial view to a string... protected string RenderPartialViewToString(string viewName, object model) { if (string.IsNullOrEmpty(viewName)) viewName =…
6
votes
4 answers

alternative asp.net MVC view engines

I was wondering if there was a general consensus on the "best" alternative view engine for asp.net MVC. So far I know of Spark, Brail, NHaml but what about others?
codette
  • 12,343
  • 9
  • 37
  • 38
6
votes
1 answer

ASP.NET MVC ViewEngine ViewLocationCache.GetViewLocation returns null

I am following Chris Pietschmann's solution for theming in ASP.NET MVC. One thing I have noticed is that the view name is not being retrieved from the ViewLocationCache on subsequent requests. I am using ASP.NET MVC 2.0 RC When the following code is…
Ben Foster
  • 34,340
  • 40
  • 176
  • 285
6
votes
2 answers

Shared layouts not found with overridden View paths (Location Formats) in ASP.NET MVC

I'm grouping my Views, Controllers and models. The structure is ~/Controllers -- /_Shared -- -- /Views -- -- /Content -- -- /Scripts -- /Home -- -- /Models -- -- /Content -- -- /Scripts -- -- /Views -- -- HomeController.cs -- /Account -- --…
Seregwethrin
  • 1,319
  • 2
  • 13
  • 24
6
votes
4 answers

Is it possible with ASP.NET MVC to render a view from a template pulled from a database?

What I'm trying to do is generate email content using different templates. I think ASP.NET MVC could be a good fit for this. My controller would get the necessary data for the email and decide which view (template) to render. (It's more that…
John Rutherford
  • 10,704
  • 7
  • 30
  • 32
5
votes
4 answers

C++ Web Framework w/ Embedded Server?

I have been looking for a C++ Web Framework that would allow me to build a GUI Control Panel directly into a .dll plugin. In the past I have used Nancy Framework for .NET Projects which was exceptional (was my first time with this type of…
user470760
5
votes
1 answer

Nustache View Engine ArrayTypeMismatchException

Trying to use Nustache to share client and server mustache templates, but Nustache is just not playing nicely with my app. I used the code straight out of their MVC application example in the source code but am getting an error every time I try to…
mmurch
  • 498
  • 5
  • 14
5
votes
2 answers

Razor View Engine Not Searching Area View Locations

I am using the default RazorViewEngine, and Area layout configuration, however when i naviagate to a link which uses a view within the area. I get a error stating the View could not be found and searched in the following locations: …
Karl
  • 659
  • 1
  • 10
  • 18
5
votes
2 answers

MVC Razor ViewEngine not thread-safe?

I currently have a .net mvc3 application that is responsible for managing similar views in multiple locations that also use the same controllers e.g site1/v1/views/index.cshtml and site1/v2/views/index.cshtml. The way that this is handled is by…
kfegen
  • 85
  • 7
5
votes
6 answers

Creating ASP.NET MVC style views in a console application?

I have a console application that requires me to send out e-mails. Right now I use a string builder to create the e-mails, but I'd like to get more fancy. Then it dawned on me: it would be nice to send my object to an ASP.NET MVC style view, where…
chum of chance
  • 6,200
  • 10
  • 46
  • 74
1 2
3
17 18