Skip to content

Example of rendering an asp.net mvc core action to a string with no HttpContext required

Notifications You must be signed in to change notification settings

waf/AspNetCoreMvcToStringExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Render Razor to String in ASP.NET Core

An example project that shows how to render a razor view and optional controller to a string. This repo contains the standard ASP.NET Core MVC project template, modified to support rendering the HomeController.Index route to a string from the command line.

Unlike other solutions available on the web, this solution does not require an HttpContext, making it suitable for scenarios like command line applications.

This is based heavily off of RazorViewToStringRenderer, however that proof-of-concept is out of date and no longer works.

About

Example of rendering an asp.net mvc core action to a string with no HttpContext required

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published