Skip to content

API Quick Reference

Mike Christensen edited this page Aug 28, 2026 · 1 revision

API quick reference

Application setup

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.

Page APIs

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.

Template commands

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

DynamicContentArgs

  • args["Name"] and GetParameter("Name") read a command attribute.
  • LoopValue contains the current item inside a loop.
  • Missing attributes return null.

Compilation exceptions

  • 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.

Clone this wiki locally