Browse Source

Update customization-user-interface.md

pull/22770/head
maliming 10 months ago
parent
commit
9103c1c0cf
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 5
      docs/en/framework/ui/mvc-razor-pages/customization-user-interface.md

5
docs/en/framework/ui/mvc-razor-pages/customization-user-interface.md

@ -89,7 +89,10 @@ This example overrides the **login page** defined by the [Account Module](../../
Create a page model class deriving from the ` LoginModel ` (defined in the ` Volo.Abp.Account.Web.Pages.Account ` namespace):
> If you are using the `AbpAccountWebOpenIddictModule` or `AbpAccountPublicWebOpenIddictModule`, the base class is `OpenIddictSupportedLoginModel` instead of `LoginModel`. And you should change the `ExposeServices` attribute to `[ExposeServices(typeof (MyLoginModel), typeof(OpenIddictSupportedLoginModel), typeof(LoginModel))]`
````csharp
[ExposeServices(typeof (MyLoginModel), typeof(LoginModel))]
public class MyLoginModel : LoginModel
{
public MyLoginModel(
@ -114,8 +117,6 @@ public class MyLoginModel : LoginModel
You can override any method or add new properties/methods if needed.
> Notice that we didn't use `[Dependency(ReplaceServices = true)]` or `[ExposeServices(typeof(LoginModel))]` since we don't want to replace the existing class in the dependency injection, we define a new one.
Copy `Login.cshtml` file into your solution as just described above. Change the **@model** directive to point to the `MyLoginModel`:
````xml

Loading…
Cancel
Save