Skip to main content

FAQ - Customizing views from embedded web applications

Developer's can change the view of an embedded web application by simply creating a new view in the host application. This is handled by the MvcCodeRouting component to allow customization and localization of embedded views for extensibility. The tricky part is that the view needs to be placed in the host web application's view folder that is based on the embedded controller name. For instance, if you register an embedded web application to the route "/Account" with the controller called AccountController, you would need to place the view in the host application's "Views/Account/Account" folder. This can be determined for other embedded web applications views by looking at their route registration, namespaces and controller names.

Changing the default Login page of the application

For this excercise, we will change the login page of the web application. The Login, change password, forgot password, etc pages are part of an embedded web application that comes with the default ELEFLEX installation. In order to change the view, we need to do the following steps:

  1. Create a new view called "Login.cshtml" and put it in a folder in the web application located at "Views/Account/Account"
  2. Copy the Login.cshtml view from our open source distribution, paste into your file and make a change. If you are trying to modify a view that you don't have source control for, read the section called "Extracting Views" from the MvcCodeRouting documentation. You can also use other developer tools to export embedded resources to begin from.
  3. Run the web application and go to the login page. You will see your changes made.