Open Closed

Use new custom User field in razor page code #785


User avatar
0
chofoza created
  • ABP Framework version: v4.1.0

  • UI type: MVC

  • DB provider: EF Core

  • Tiered (MVC) or Identity Server Seperated (Angular): no

Hi, I feel like this is an easy one...

I have a new property (bool Active) on the User object, stored in ExtraProperties. I want to reference it on the razor page, but the CurrentUser (ICurrentUser) object doesn't have it or ExtraProperties. How can I read the value?

In my example basically I want to do:

@if (CurrentUser.IsAuthenticated && CurrentUser.ExtraProperties["Active"])


2 Answer(s)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 13, 2025, 04:08