473,657 Members | 2,550 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Nov 18 '05 #1
2 5850
Create a class that inherits System.Web.UI.P age, 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.P age, 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" <ja**********@s olversa.com> wrote in message
news:e2******** ******@TK2MSFTN GP09.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

Nov 18 '05 #2
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" <ja**********@s olversa.com> wrote in message
news:e2******** ******@TK2MSFTN GP09.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

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3124
by: Paul | last post by:
Hi all, at present I I've built a website which can be updated by admin and users. My problem, I've combined "log in" and "access levels" to restrict access to certain pages, using the built in "log in" and "user authentication, restrict access to page" features. But I find the after login I constantly get redirected from the restricted pages.
1
252
by: Gaurav | last post by:
Hi, We are developing a .NET app which has forms authentication. When the user types in the direct URL of an aspx page on the browser, he will be thrown to the login page. But if the URL points to a .txt or .doc file, the document is displayed even though the user is not authenticated. How do we stop this such that the user has to login to the application and then view the documents.
10
13069
by: shankhar | last post by:
Hi all, In my project there is a requirement. If a user logged in at a time since he/she logged out others are not allowed to loggin using the same user name. That is to avoid multiple logins using a account. How to do this? I had got a idea and implemented. 1. When a user logs in storing the username, ip, login time to db.
2
3256
by: venkat | last post by:
Hi, i came across restrict qualifier while looking the code. I haven't able to understand what does this do?. Can some one help me how does this makes the things restrict to an specified objects. It will be good, if explained with example. Appriciate your help in this regard. Thanks,
3
3590
by: =?Utf-8?B?R1ROMTcwNzc3?= | last post by:
Hi there, I've got the standard Dreamweaver restrict access to page behaviour below – <% ' *** Restrict Access To Page: Grant or deny access to this page MM_authorizedUsers="1,2,3" MM_authFailedURL="index.asp" MM_grantAccess=false If Session("MM_Username") <"" Then If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
23
4819
by: raashid bhatt | last post by:
what is restrict keyword used for? eg int *restrict p;
4
11422
by: vinpkl | last post by:
hi i am working on admin section which has a login page with login id and pasword form. in my admin section i have many pages say like manage_products.php, description.php, user.php etc. if i have to access the manage_products.php page then i can access it just typing like the link below http://localhost/vineet/admin/manage_products.php without entering login user and pasword.
2
3372
by: yogarajan | last post by:
hi friends i have one problem. i m using forms authentication for my pages which consist of downloadable links (doc files, pdf files etc.,). the thing is, if i restrict access to the page, it works fine ( redirects anonymous users to login page). however, if someone types the url of the documents directly (ex:- mywebserver/myapp/downloads/documentname, it directly downloads without authenticating. any way to restrict direct downloading...
2
1502
by: premMS143 | last post by:
Hi everyone, I'm using ASP.NET & VB for programming. The problem is restricting the users based on the user types. I've several user types, like Admin, Student, Parent, Coordinator etc. Each user type has having certain limitations of form usage. For ex:
0
8425
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8326
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8743
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8522
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2745
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.