Imp (In Memory Pages) is a lightweight page framework built on ASP.NET Core middleware. It maps request paths to .NET classes, creates pages through dependency injection, binds query-string values to page properties, and renders responses directly or through embedded XML templates.
Imp supports the actively maintained .NET 8 and .NET 10 LTS releases.
Given this page class:
using System.Text.Encodings.Web;
using System.Threading.Tasks;
using Imp;
using Microsoft.AspNetCore.Http;
namespace MySite.Pages;
public sealed class Hello : BasePage
{
public string Name { get; set; } = "World";
public override Task Render(HttpResponse response)
{
string name = HtmlEncoder.Default.Encode(Name);
return response.WriteAsync($"<h1>Hello, {name}!</h1>");
}
}Imp maps the request:
/hello?Name=Mike
to MySite.Pages.Hello, binds Mike to its Name property, and renders:
<h1>Hello, Mike!</h1>That is Imp's central model: URL paths map to page classes, and query-string parameters map to public writable properties. Query-property names are case-sensitive, so this example uses Name, not name.
Install the package:
dotnet add package KitchenPC.ImpThen follow the Wiki's Getting Started guide to configure the middleware and create your first page.
For a complete working application, see the Todo sample or read its guided tour.
The Imp Wiki contains the complete developer guide:
- Architecture and request lifecycle
- Routing and page classes
- Pages and direct rendering
- Embedded templates and layouts
- Dynamic content, constants, and loops
- Forms, postbacks, and antiforgery
- Dependency injection and lifetimes
- Authentication and secure pages
- Static assets and CDN paths
- Configuration reference
- API quick reference
- Testing and diagnostics
- Troubleshooting
From the repository root:
dotnet testTo create local NuGet and symbol packages:
dotnet pack src/Imp/Imp.csproj --configuration Release --output artifactsSee Build, Package, and Contribute for repository structure, release details, and contribution guidance.
Imp is available under the MIT License.