🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
StartupViewTemplate
This page was created by Hans.karlsen on 2024-04-03. Last edited by Wikiadmin on 2026-07-29.

You can customize the page shown to users while a .NET Core Turnkey application is starting, including a return URL that sends the user back to the page they originally requested.

Purpose

A Turnkey application can need time to start. During startup, it extracts the model from MDrivenServer and expands it to disk. On later starts, the expanded model can be reused when the model checksum has not changed.

Until the Turnkey application has fully started, Turnkey returns a startup page instead of the requested application page. The startup-page mechanism is intended for .NET Core Turnkey deployments.

How the startup template is processed

The default template is:

views\\turnkey\\StartupViewTemplate.htm

When Turnkey returns this page, it reads the file and replaces tokens before sending the result to the client.

Token Replaced with Use it for
###BASEURL### The application-server URL from Common.GetApplicationServerUrl() Links, scripts, or other resource URLs that must point to the application server.
###GOALURL### The original URL the user attempted to reach Returning the user to the requested page after startup completes.

For example, if a user requests a page while the application is still starting, use ###GOALURL### in the startup template where the page needs to preserve that destination. The value represents the original request, not a replacement URL chosen by the template.

Customize the displayed startup page

Do not edit the generated or default template when you want an application-specific startup page. Provide an override file instead.

  1. Create a file named StartupViewTemplate_AppOverride.htm.
  2. Place it in _AssetsTK\\Views\\EXT_OverridePages\\.
  3. Add the HTML, styling, and client-side behavior for the startup experience.
  4. Keep ###BASEURL### where your page needs the application-server URL.
  5. Keep ###GOALURL### where your page needs to return the user to the original request.

The override page works the same way as the default startup template: Turnkey replaces both tokens before it returns the page.

Example token usage

The following fragment illustrates the intended use of the tokens. It is an example of token placement; adapt the surrounding HTML to your application.

<a href="###GOALURL###">Continue to the requested page</a>
<script src="###BASEURL###/path-to-your-script.js"></script>

Plan for routing and sign-in

Treat startup handling as part of your application's routing design. A startup page may be returned before the normal application route is ready, while external login and redirects may also be in progress.

Test the behavior for both URL forms used by your application:

  • Client-side routes that use a # fragment, such as Angular routes.
  • Full server URLs, such as URLs used by DWV and Blazor.

In each case, verify that the original destination survives startup and any external-login redirect. Do not assume that a fragment route and a full URL are handled identically.

.NET Framework Turnkey

This template mechanism applies to Turnkey on .NET Core. Turnkey on .NET Framework uses IIS startup-page support instead. Configure the startup page in web.config as described in Simple URLs and Azure redirect.

That article also shows IIS rewrite rules for short URLs and redirects. Use the IIS configuration approach for Framework deployments; use StartupViewTemplate_AppOverride.htm for .NET Core Turnkey startup-page customization.

See also