Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have problem that I need to sort out with project I am building.

I know how to use "user.Inrole" etc to limit to what a certain type of user can see depending on the role.

Now let's say when a guest logs in(after registering) is redirected to their index page where it says to create profile.

They create the profile and once after can few details and book appointments.

Now, something I have noticed. How do I stop them once they login in from creating multiple profiles?

Is their away to hide the create button from view once created?

But I want to ensure when others register too, they can only create a profile once.

What I have tried:

(Sorry for not posting any code)
Posted
Updated 6-Aug-21 6:25am

It always struck me whether there's a built-in place to perform such a check in MVC. But my experience tells me there's none which means that you need to add a custom method to your model which verifies this constraint and check it both on view side and inside a controller.
 
Share this answer
 
Quote:
Now let's say when a guest logs in(after registering) is redirected to their index page where it says to create profile.

Looks like you take the problem in reverse.
1 user have 1 register and 1 profile.
Registering information and profile goes in same table.
When you redirect in profile page, user fills profile created while registering.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900