We have a pluggable framework that returns ActionResult objects that render things to a browser. One late breaking requirement is that our plugins should be callable from a regular ASP.NET Web Forms application.
So far I have come up with this, which works for very basic ActionResults:
public class ActionResultTranslator {
HttpCo...
I am attempting to impliment a custom view engine to serve mobile views based on the user agent. I am following Scott Hanselman's approach from this blog post.
I have inherited from the WebFormsViewEngine and overridden the FindView method the same way that Scott describes in his blog.
I then added a few lines to my Global.asax Applica...
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:
<ul if="products.Any()">
<li each="var p in products">${p.Name}</li>
</ul>
<else>
<p>No pr...
When is the MasterPageFile property of a view/page checked that it exists in ASP.NET MVC WebForms view engine?
What I want to do is have the following code not output the error:
Parser Error Message: The file '/SomePlaceThatDosentExist/Site.Master' does not exist.
Defined as such in my view's .aspx file:
<%@ Page Language="C#" Ma...
Hi,
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 executed:
this.ViewLocationCache.InsertViewLocation(controllerContext.HttpContext...
I have a controller on my site that handles unknown actions and returns a view if it exists. This is so that static content can be added to this particular area of the site without having to modify the controller. The problem I am faced with now is to create a sitemap.xml file that contains links to all of these "unknown" views. What ...
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, which will cache one of 2 view (PC view) and then when i tried to access through mobile, it ...
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?
...
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... anyone tried to port it to C#? It would be really useful in a lot of situations and I'm go...
I have the following folder structure in an ASP.NET MVC 2 app using Spark.
[site root]
home
HomeController.cs
Views
Shared
Index.spark
However, if I move Index.spark into the /home folder, I get the following error:
The view 'Index' or its master was not found. The following locations were searched:
...
Is there a way to include some aspx/ascx markup in a DLL and use that to generate text dynamically? I really just want to pass a model instance to a view and get the produced html as a string. Similar to what you might do with an XSLT transform, except the transform input is a CLR object rather than an XML document. A second benefit i...
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 whitespace on the view. For security reasons I want my viewmodels to be sparse as possible. ...
Recently I created a spike of a view engine, in which views are plain classes, and the content is created by using funny using-scope blocks.
The code together with a simple sample site is available at http://code.google.com/p/sharp-view-engine/
Here I'd like to hear your opinions regarding such an idea. Is it completely weird or maybe ...
I was going through the spark view engine documentation and found a lot of literals showing up in code for which I couldn’t find any references. For e.g.
! , #, $ , !$ , ...
What are these for? What do the combinations mean? When do they come into use? Am I missing any more literals that precede or comes after {
...
Hi,
I'm thinking of experimenting with alternative View Engines for ASP.NET MVC, and would like to know what other people are using.
Please let me know 1) Which View Engine you use, and 2) Why.
The standard 'web-forms' view engine is of course a valid answer, but please say so only if you have decided to use it for a reason, not just ...
I used the code below so far with ASP.NET MVC v1 and v2 but when I added an Area today to my application, the controller for the area couldn't find any views in my Areas/Views/controllerView folder. It issued the very well known exception that it searched those 4 standard folders but it did not look under Areas..
How can I change the co...
I was thinking about switching one of my projects (and after that subsequently other projects too) to Spark View Engine but after todays research I ran into problem of a lack of Intellisense for Visual studio 2010. Not only that but it seems that the project is not maintained regularly.
So I'm left with a feeling that I should not choos...
Assuming I write a custom attribute...
public class SpecialActionFilterAttribute : System.Web.Mvc.ActionFilterAttribute
{
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
}
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
// set some parameters here. ...
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, string page)
{
return View(folder, page);
}
I want the view engine to search for the vi...
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?
...