abp icon indicating copy to clipboard operation
abp copied to clipboard

MVC Startup Template

Open Vayth opened this issue 7 years ago • 5 comments

Any startup template with normal MVC instead of Razor Pages? I'm still new to Razor and, embarrassingly, have difficulty to change even the default (and hidden?) Login Page..

Vayth avatar May 30 '19 10:05 Vayth

MVC approach already works in the startup template. Did you try?

Login page is not hidden, but used as a library. What changes do you need on the login page?

hikalkan avatar May 30 '19 10:05 hikalkan

Something like branding or editing the html. It's the same when I create MVC default template in VS (non-ABP), account management is there in pages folder, but hidden and I had to use dotnet aspnet-codegenerator to make them appear so I can edit them. I can't just create a view and controller to the same url /account/login.

Is it the same with ABP? Because I don't see the pages either. Maybe I'm just not used to UI library (and overriding them) yet.

Vayth avatar May 30 '19 11:05 Vayth

You can override any razor page view using the virtual file system. You can see account module files in the repository. For example, Login page is like that: https://github.com/abpframework/abp/blob/master/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml

If you want, you can completely copy the account module into your solution (and remove nuget packages) to edit it: https://github.com/abpframework/abp/tree/master/modules/account But I don't suggest it since then you can not get updates.

hikalkan avatar May 30 '19 11:05 hikalkan

Thanks, it's not as straightforward as creating a physical file as it says, but I'll look for virtual file system more and find some sample. In the worst case, I'll just create a new project for the frontend.

Vayth avatar May 30 '19 13:05 Vayth

It can be a little daunting but like mentioned the template is an MVC project it's just using razor pages. Delete the pages folder and create a Views and Controllers folder and create the appropriate controllers for the views and it'll work. Inherit your controller from AbpController to get all the goodness that comes with that (current user etc.)

wayneboyles avatar May 30 '19 13:05 wayneboyles