Results 1 to 6 of 6

Thread: member & non Member pages

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2008
    Posts
    407

    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?
    My Websites
    SharpMP3 - MP3 Design Articles www.sharpmp3.com
    Yobbers - Job Search www.yobbers.com
    Lets Trend - Methods For Riding Stock Trends www.letstrend.com

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2008
    Posts
    407

    Re: member & non Member pages [RESLOVED]

    nevermind I figured it out. Login view contorl
    My Websites
    SharpMP3 - MP3 Design Articles www.sharpmp3.com
    Yobbers - Job Search www.yobbers.com
    Lets Trend - Methods For Riding Stock Trends www.letstrend.com

  3. #3
    Frenzied Member brin351's Avatar
    Join Date
    Mar 2007
    Location
    Land Down Under
    Posts
    1,293

    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
    Last edited by brin351; Aug 30th, 2010 at 12:38 AM. Reason: correction
    The problem with computers is their nature is pure logic. Just once I'd like my computer to do something deluded.

  4. #4
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2008
    Posts
    407

    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?
    My Websites
    SharpMP3 - MP3 Design Articles www.sharpmp3.com
    Yobbers - Job Search www.yobbers.com
    Lets Trend - Methods For Riding Stock Trends www.letstrend.com

  6. #6
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width