Restrict user if user directly types url of any page

Discussion in 'ASP .Net' started by Jaydeep, Dec 2, 2003.

  1. Jaydeep

    Jaydeep Guest

    Hi,
    I want to restrict any user if he types url directly in the browser
    without logging to my site. Like for example user should not see any listing
    page of my web site by typing url http://localhost/customerList.aspx or
    something like that, instead he should first login and then access this
    page. How to achieve this functionality.
    In classical ASP we used to include a common file which checks if cookie is
    set or not or using HTTP_REFERRER server variable. How to include such file
    in asp.net page ?

    Thanks
    --
    Jaydeep Vaze
    Solversa Technologies
     
    Jaydeep, Dec 2, 2003
    #1
    1. Advertising

  2. Create a class that inherits System.Web.UI.Page, and put your code into that
    class. Override the Base class's OnInit() Method in your derived class, and
    put the code that checks the Session in there. Then, for your web pages,
    rather than inheriting System.Web.UI.Page, inherit that page class. This
    will add the functionality you're desiring to every Page, transparently.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Jaydeep" <> wrote in message
    news:...
    > Hi,
    > I want to restrict any user if he types url directly in the browser
    > without logging to my site. Like for example user should not see any

    listing
    > page of my web site by typing url http://localhost/customerList.aspx or
    > something like that, instead he should first login and then access this
    > page. How to achieve this functionality.
    > In classical ASP we used to include a common file which checks if cookie

    is
    > set or not or using HTTP_REFERRER server variable. How to include such

    file
    > in asp.net page ?
    >
    > Thanks
    > --
    > Jaydeep Vaze
    > Solversa Technologies
    >
    >
     
    Kevin Spencer, Dec 2, 2003
    #2
    1. Advertising

  3. Jaydeep

    Colin Young Guest

    ASP.Net provides an authentication system in the web.config file. You can
    specify for an entire directory (including its subdirectories) that only
    authenticated users are allowed to view pages, and if a user is not
    authenticated they will be redirected to a login form and then automatically
    redirected to the original page they requested after a successful login.

    Google ASP.Net authentication for some articles.

    If you need to check individual pages (i.e. not an entire directory) you
    will need to test pages manually.

    Colin

    "Jaydeep" <> wrote in message
    news:...
    > Hi,
    > I want to restrict any user if he types url directly in the browser
    > without logging to my site. Like for example user should not see any

    listing
    > page of my web site by typing url http://localhost/customerList.aspx or
    > something like that, instead he should first login and then access this
    > page. How to achieve this functionality.
    > In classical ASP we used to include a common file which checks if cookie

    is
    > set or not or using HTTP_REFERRER server variable. How to include such

    file
    > in asp.net page ?
    >
    > Thanks
    > --
    > Jaydeep Vaze
    > Solversa Technologies
    >
    >
     
    Colin Young, Dec 2, 2003
    #3
  4. Jaydeep

    vedcyrus

    Joined:
    Jun 28, 2006
    Messages:
    1
    Restrict user to access web page

    Hi jaydeep
    I have the same problem u r facing. Please let me know the solution if you found.

    thanx and regards

    chandan
     
    vedcyrus, Jun 30, 2006
    #4
    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. =?Utf-8?B?ZGhucml2ZXJzaWRl?=

    HtmlInputFile restrict file types

    =?Utf-8?B?ZGhucml2ZXJzaWRl?=, Feb 4, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,427
    =?Utf-8?B?ZGhucml2ZXJzaWRl?=
    Feb 4, 2005
  2. jonesy
    Replies:
    0
    Views:
    556
    jonesy
    Oct 26, 2006
  3. Luqman
    Replies:
    4
    Views:
    1,232
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Sep 17, 2007
  4. Jens Thoms Toerring

    Restrict types of template functions

    Jens Thoms Toerring, Sep 19, 2010, in forum: C++
    Replies:
    8
    Views:
    475
    Jens Thoms Toerring
    Sep 20, 2010
  5. haode
    Replies:
    1
    Views:
    107
    Alexander Popkov
    Jun 12, 2004
Loading...

Share This Page