member & non Member pages
Hi Guys,
I'm trying to create a member section for my website and a non member section. I want the nonmember pages to have access to all the member pages but just not certain features like saving to the database.
Is there a way to have the same page for both members and non members but have certain controls like buttons and other things that are only usable to the member that is logged in?
Re: member & non Member pages [RESLOVED]
nevermind I figured it out. Login view contorl
Re: member & non Member pages
You can also test for authenticated users in code like.
Code:
If user.IsAuthenticated Then
do something for member
Else
do something for non-member
End If
Re: member & non Member pages
Hey,
LoginView will do the UI work for you, yes. However, you SHOULD ALWAYS do additional checking in the methods that you are using to touch the database. I would recommend that you use the suggested code from brin to make sure that the current Request is allowed to take the requested action.
Gary
Re: member & non Member pages
Why is that gary? The login view doesn't do that good of job and you can get around it?
Re: member & non Member pages
No, not at all.
The LoginView does exactly what it is meant to. It is more just good practice though. You should always authenticate the user both at the UI and the business logic levels. Here, you are using the LoginView to authenticate the user at the UI level, but in addition, within your business logic, you should again check to make sure that the current request is authenticated.
Gary