-
Notifications
You must be signed in to change notification settings - Fork 0
API Quick Reference
Mike Christensen edited this page Aug 28, 2026
·
1 revision
| API | Purpose |
|---|---|
IApplicationBuilder.UseImp(...) |
Adds terminal Imp middleware and builds configuration. |
ImpConfiguration.PageAssembly |
Selects page/resource assembly. |
RootPageNamespace |
Prefix for path-derived page types. |
RootTemplateNamespace |
Prefix for reusable template resources. |
NotFoundPageType<T> |
Configured fallback page. |
OnNotFound |
Custom fallback route callback. |
OnPreRender |
Global synchronous lifecycle callback. |
Authenticate |
Gate for [SecurePage]. |
CdnPrefix / OnBuildCdnPath
|
Transform Cdn.* template attributes. |
| API | Purpose |
|---|---|
BasePage.Request |
Current HttpRequest, assigned after construction. |
BasePage.PreRender(response) |
Synchronous per-page preparation hook. |
BasePage.Render(response) |
Direct response rendering when no template is attached. |
[PageTemplate(resource)] |
Associates an embedded page template. |
[SecurePage] |
Marks a page for the configured authentication callback. |
IPostable.Postback(response) |
Synchronous POST handler. |
IAsyncPostable.PostbackAsync(response) |
Asynchronous POST handler; preferred. |
| Command | Required page member |
|---|---|
<Dynamic.Name /> |
public Task Name(TextWriter, DynamicContentArgs) |
<Const.Name /> |
public literal field named Name
|
<Loop.Items>...</Loop.Items> |
public parameterless IEnumerable Items()
|
<Template.Site>...</Template.Site> |
{RootTemplateNamespace}.Site.htm resource |
<Placeholder.Body /> |
matching <Content.Body> in the invoking page template |
Cdn.href, Cdn.src, etc. |
configuration transforms value and removes Cdn. prefix |
-
args["Name"]andGetParameter("Name")read a command attribute. -
LoopValuecontains the current item inside a loop. - Missing attributes return
null.
-
PageCompileException— base compilation failure. -
PageMethodNotFoundException— referenced dynamic/loop method is absent. -
PageMethodBindingException— member cannot bind to the expected delegate. -
StaticResourceNotFoundException— layout or constant resource is absent. -
MissingStaticResourceManagerException— template composition lacks a resource manager.
Treat these as deployment/programming failures rather than user input errors.
Imp is MIT licensed. See the source and Todo sample on GitHub.
Imp
Templates
Application integration
- Forms and antiforgery
- Dependency injection
- Authentication and secure pages
- Static assets and CDN paths
- Configuration reference
Help and reference