<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/sharpy---an-asp-net-mvc-view-engine-based-on-smarty-oxmew2e1t" -->

---
title: Sharpy - an ASP.NET MVC view engine based on Smarty
description: Sharpy is an ASP.NET MVC view engine that mimics the Smarty templating syntax popular in PHP, offering designer-friendly markup as an alternative to the...
canonical: https://daily.dev/posts/sharpy---an-asp-net-mvc-view-engine-based-on-smarty-oxmew2e1t
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Sharpy - an ASP.NET MVC view engine based on Smarty | daily.dev
og:description: Sharpy is an ASP.NET MVC view engine that mimics the Smarty templating syntax popular in PHP, offering designer-friendly markup as an alternative to the...
og:url: https://daily.dev/posts/sharpy---an-asp-net-mvc-view-engine-based-on-smarty-oxmew2e1t
og:image: https://api.daily.dev/og/posts/OXmeW2e1t.png
og:image:alt: Sharpy - an ASP.NET MVC view engine based on Smarty
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Sharpy - an ASP.NET MVC view engine based on Smarty

**[Maarten Balliauw](https://daily.dev/sources/maartenballiauw)** · 3 min read · 0 upvotes · 0 comments

## Summary

Sharpy is an ASP.NET MVC view engine that mimics the Smarty templating syntax popular in PHP, offering designer-friendly markup as an alternative to the default Webforms engine, Spark, or NHaml. It supports master pages, partial views, foreach loops, and variable modifiers like escape and date formatting. Extensibility is a core feature: every function (inline, block, expression, or modifier) is implemented as a MEF-exported plugin, so developers can add custom functions the same way built-in ones are implemented. An example custom 'content' function is shown alongside links to Jaco Pretorius' blog posts covering functions, expressions, master pages, and extending Sharpy.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.maartenballiauw.be/posts/2010-02-22-sharpy-an-aspnet-mvc-view-engine-based-on-smarty>

## Questions this post answers

### How does the Sharpy view engine let me extend it with custom functions in ASP.NET MVC?

Sharpy exposes every view function as a plugin through the Managed Extensibility Framework (MEF), using one of four interfaces: IInlineFunction, IBlockFunction, IExpressionFunction, or IVariableModifier. You implement the interface, export it with [Export(typeof(IInlineFunction))], and Sharpy automatically picks it up. Built-in functions use the exact same mechanism as custom ones, so there's no special-cased internal API.

_daily.dev surfaces practical extensibility patterns like this for developers comparing MVC view engines._

### What template syntax does the Sharpy ASP.NET MVC view engine use compared to Razor or Webforms?

Sharpy uses Smarty-style syntax, the same templating language familiar from PHP's Smarty engine, rather than Razor or Webforms markup. Examples include {master file='...'} for specifying a master page, {foreach from=$Model item="entry"}...{/foreach} for loops, and pipe-based variable modifiers like {$entry.Body|escape} or {$entry.Date|date_format:"dd/MMM/yyyy"} for formatting output.

_Developers evaluating alternative MVC view engines can track syntax comparisons like this on daily.dev._

## Similar posts on daily.dev

- [htmxRazor v1.4.0: SSE Streaming, Multi-step Wizard, and Optimistic UI - Chris Woody Woodruff](https://daily.dev/posts/htmxrazor-v1-4-0-sse-streaming-multi-step-wizard-and-optimistic-ui---chris-woody-woodruff-djatrl3bc) · We Are .NET · 20 upvotes · 0 comments
- [Understanding Partial Views in ASP.NET MVC](https://daily.dev/posts/understanding-partial-views-in-asp-net-mvc-salagpukh) · C\# Corner · 1 upvotes · 0 comments
- [PyView: Real-time Python Web Apps](https://daily.dev/posts/pyview-real-time-python-web-apps-2huh9on7d) · Planet Python · 0 upvotes · 0 comments
- [Modern Frontend Complexity: essential or accidental?](https://daily.dev/posts/modern-frontend-complexity-essential-or-accidental--yrurnb4gq) · Lobsters · 2 upvotes · 0 comments

---

[View this post on daily.dev](https://daily.dev/posts/sharpy---an-asp-net-mvc-view-engine-based-on-smarty-oxmew2e1t)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Sharpy - an ASP.NET MVC view engine based on Smarty","url":"https://daily.dev/posts/sharpy---an-asp-net-mvc-view-engine-based-on-smarty-oxmew2e1t","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/sharpy---an-asp-net-mvc-view-engine-based-on-smarty-oxmew2e1t"},"datePublished":"2026-10-04T13:05:23.460Z","dateModified":"2026-10-15T02:22:12.942Z","description":"Sharpy is an ASP.NET MVC view engine that mimics the Smarty templating syntax popular in PHP, offering designer-friendly markup as an alternative to the...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/62a0f334dfb50d330996aa8d50900b0a?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/62a0f334dfb50d330996aa8d50900b0a?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Maarten Balliauw","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Maarten Balliauw","logo":"https://media.daily.dev/image/upload/s--rOTg3VYO--/f_auto,q_auto/v1791119043/logos/maartenballiauw?_a=BAMAMicg0","url":"https://daily.dev/sources/maartenballiauw"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/sharpy---an-asp-net-mvc-view-engine-based-on-smarty-oxmew2e1t","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Maarten Balliauw","item":"https://daily.dev/sources/maartenballiauw"},{"@type":"ListItem","position":3,"name":"Sharpy - an ASP.NET MVC view engine based on Smarty"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/sharpy---an-asp-net-mvc-view-engine-based-on-smarty-oxmew2e1t#faq","mainEntity":[{"@type":"Question","name":"How does the Sharpy view engine let me extend it with custom functions in ASP.NET MVC?","acceptedAnswer":{"@type":"Answer","text":"Sharpy exposes every view function as a plugin through the Managed Extensibility Framework (MEF), using one of four interfaces: IInlineFunction, IBlockFunction, IExpressionFunction, or IVariableModifier. You implement the interface, export it with [Export(typeof(IInlineFunction))], and Sharpy automatically picks it up. Built-in functions use the exact same mechanism as custom ones, so there's no special-cased internal API. daily.dev surfaces practical extensibility patterns like this for developers comparing MVC view engines."}},{"@type":"Question","name":"What template syntax does the Sharpy ASP.NET MVC view engine use compared to Razor or Webforms?","acceptedAnswer":{"@type":"Answer","text":"Sharpy uses Smarty-style syntax, the same templating language familiar from PHP's Smarty engine, rather than Razor or Webforms markup. Examples include {master file='...'} for specifying a master page, {foreach from=$Model item=\"entry\"}...{/foreach} for loops, and pipe-based variable modifiers like {$entry.Body|escape} or {$entry.Date|date_format:\"dd/MMM/yyyy\"} for formatting output. Developers evaluating alternative MVC view engines can track syntax comparisons like this on daily.dev."}}]}
```

