Customizing login and other account UI MVC
This page was created by Hans.karlsen@mdriven.net on 2022-03-08. Last edited by Charles@mdriven.net on 2025-03-18.

The UI that Turnkey and custom built web apps using the MDriven.ASPNETIdentity implementation can be easily overriden by following this strategy.

This is explained in the context of MDriven Turnkey - buut will follow the same pattern for other application using MDriven.ASPNETIdentity.

  1. Remember that Account controller has different implementations for MVC4(.net5+) and MVC4 (framework 4.7), the override behaves the same for both controllers (AccountControllerBase and AccountControllerBaseForCore)
  2. The controller has been given a new string property AccountOverride if this is assigned all account cshtml views will be sought after first in Views/Account/EXT_AccountOverride/<AccountOverride-value>
  3. If the sought after UI is not found in the override position - the standard position will be used Views/Account - this is also true if AccoountOverride is null or empty
    2022-03-08 18h56 00.png
    In the image above the Login and Register has been overriden and will come into play if and only if the AccountController.AccountOverride == "test"
  4. In MDriven Turnkey you give a value to AccountController.AccountOverride by implementing a string attribute on SysSingleton: