All posts in asp.net

How to render a view to a string in ASP.NET MVC

It's a pretty common requirement if you need a view or partial rendered as a string. For example: In a product database you have different articles for each product, which define the different colors. Each article contains an availability table for each size. If you want to live update the site when changing the color (therefore article), you can make …
read story

String Indexer for Text Resources in Nancy

In the last post Build a custom Razor ViewBase in Nancy we have built a ViewBase, which allows us to access new public methods and properties in the views. The example used a dictionary containing translations. This was by far not the best use-case example, as Nancy provides built-in support for text resources. By creating a resource (.resx) file and …
read story

Build a custom Razor ViewBase in Nancy

This is a simple example on how to pass model data (in this case an anonymous dynamic) to a Razor view using Nancy modules: public IndexModule() { Get["/"] = _ => { return View["Index", new { Name = "Tobias" }]; }; } You can call this data in the view easily with @Model.Name. This post is about being able to **access common properties and helpers easily** without …
read story

What’s New in ASP.NET by Scott Hanselman (at //build/)

Scott Hanselman talked about what's new in ASP.NET at the Microsoft developer conference //build/ this week. The talk covers: One ASP.NET - a unified ASP.NET including MVC, Web Forms, Web API or whatever framework you want in it. This is an awesome move by the ASP.NET team, which let's you take the best from all frameworks …
read story