Prevent user from accessing any page directly without Login ?

Discussion in 'ASP .Net' started by Luqman, Sep 16, 2007.

  1. Luqman

    Luqman Guest

    How can I Prevent user from accessing any page directly without Login ?

    User should not be able to by pass the Login screen by typing the Url of any
    page directly.

    I am using ASP.Net 2.0 with Visual Studio 2005.

    Best Regards,

    Luqman
     
    Luqman, Sep 16, 2007
    #1
    1. Advertising

  2. One way would be to place a logged-in valid value in your Session object for
    this user. Each page checks the Session object for this value, and
    redirects to an error page if it's not set correctly. Each user has a
    unique Session object in ASP .NET.

    "Luqman" <> wrote in message
    news:ewpV0gJ%...
    > How can I Prevent user from accessing any page directly without Login ?
    >
    > User should not be able to by pass the Login screen by typing the Url of

    any
    > page directly.
    >
    > I am using ASP.Net 2.0 with Visual Studio 2005.
    >
    > Best Regards,
    >
    > Luqman
    >
    >
    >
    >
     
    David C. Barber, Sep 16, 2007
    #2
    1. Advertising

  3. Enable Roles and then for example in web.config

    <authorization>
    <allow roles="Customer, Administrator, Inactive"/>
    <deny users="*"/>
    </authorization>

    hth

    --
    More on ASP.NET and Silverlight on my blog: http://www.andreas-kraus.net/blog


    "Luqman" wrote:

    > How can I Prevent user from accessing any page directly without Login ?
    >
    > User should not be able to by pass the Login screen by typing the Url of any
    > page directly.
    >
    > I am using ASP.Net 2.0 with Visual Studio 2005.
    >
    > Best Regards,
    >
    > Luqman
    >
    >
    >
    >
    >
     
    =?Utf-8?B?QW5kcmVhcyBLcmF1cw==?=, Sep 16, 2007
    #3
  4. Not to sound like a corrupt MP3, but you can get all this information with
    example code by following the QUICKSTART samples. These install with either
    Visual Studio, or the .NET Framework., and you can also view online at the
    asp.net web site.
    Peter
    --
    Recursion: see Recursion
    site: http://www.eggheadcafe.com
    unBlog: http://petesbloggerama.blogspot.com
    BlogMetaFinder: http://www.blogmetafinder.com



    "Luqman" wrote:

    > How can I Prevent user from accessing any page directly without Login ?
    >
    > User should not be able to by pass the Login screen by typing the Url of any
    > page directly.
    >
    > I am using ASP.Net 2.0 with Visual Studio 2005.
    >
    > Best Regards,
    >
    > Luqman
    >
    >
    >
    >
    >
     
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Sep 17, 2007
    #4
  5. The typical solution is Forms Authentication, which is built into ASP.NET.
    Here's more info:
    http://www.dotnetbips.com/articles/2fdd29a0-9313-4439-9e24-4e2a9f2cb897.aspx
    http://www.dotnetbips.com/articles/8de08fdb-1150-47f5-9831-133dd25b308b.aspx

    Combine that with the new login controls of ASP.NET 2.0 and you've got
    pretty much everything you need with virtually no code required. Here's
    more info on that:
    http://SteveOrr.net/articles/SecureYourSite.aspx

    --
    I hope this helps,
    Steve C. Orr,
    MCSD, MVP, CSM, ASPInsider
    http://SteveOrr.net


    "Luqman" <> wrote in message
    news:ewpV0gJ%...
    > How can I Prevent user from accessing any page directly without Login ?
    >
    > User should not be able to by pass the Login screen by typing the Url of
    > any page directly.
    >
    > I am using ASP.Net 2.0 with Visual Studio 2005.
    >
    > Best Regards,
    >
    > Luqman
    >
    >
    >
    >
     
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider], Sep 17, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. William F. Robertson, Jr.
    Replies:
    0
    Views:
    445
    William F. Robertson, Jr.
    Jul 2, 2003
  2. swbaz
    Replies:
    2
    Views:
    638
    Jordan Marton
    Aug 13, 2003
  3. Jaydeep
    Replies:
    3
    Views:
    1,053
    vedcyrus
    Jun 30, 2006
  4. ABC
    Replies:
    0
    Views:
    655
  5. veera maria
    Replies:
    4
    Views:
    479
Loading...

Share This Page