Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Restrict user if user directly types url of any page (http://www.velocityreviews.com/forums/t67966-restrict-user-if-user-directly-types-url-of-any-page.html)

Jaydeep 12-02-2003 01:01 PM

Restrict user if user directly types url of any page
 
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 12-02-2003 01:59 PM

Re: Restrict user if user directly types url of any page
 
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" <jaydeep.vaze@solversa.com> wrote in message
news:e2FhQSNuDHA.2448@TK2MSFTNGP09.phx.gbl...
> 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 12-02-2003 03:16 PM

Re: Restrict user if user directly types url of any page
 
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" <jaydeep.vaze@solversa.com> wrote in message
news:e2FhQSNuDHA.2448@TK2MSFTNGP09.phx.gbl...
> 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
>
>




vedcyrus 06-30-2006 04:40 AM

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


All times are GMT. The time now is 02:27 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.