473,789 Members | 2,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forms authentication - restricting certain pages

Hi
I want to have most of my website available to users without any
authentication (ie. they can freely browse). However, if they go to a
restricted part, they should be redirected to a login page, and then
authenticated.

I don't want to use SQL Server, as I would have to pay for that with my
host. I would prefer to use Access, or even a custom method.

Does anyone have any sample code, or can point me to some resource examples?

Thanks
Oct 1 '06 #1
1 1442
You can do it with Access just as easily as SQL Server. Any datasource will
work just fine and you can even put users into the web.config file if you
need to. Basically, you can write your own authentication method if you
need, and then just use some of the forms authentication features to handle
all your redirection and writing of the forms authentication cookies.

Check out some of these links as good starting points:

http://samples.gotdotnet.com/quickstart/aspplus/

http://www.15seconds.com/issue/020220.htm

http://msdn.microsoft.com/library/de...tionevents.asp

http://www.4guysfromrolla.com/webtech/110701-1.shtml

The trick will be, you can only have one login form per application. You can
use the location element in the forms authentication config area to define
files that certain users can get access to.

There's also a sample project for the Membership providers done in MS
Access. You'll need at least Visual C# Express (which is free) to compile
it. To get it go to http://msdn.microsoft.com/vstudio/do...s/starterkits/
and scroll down to the Sample Access Provider link.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Paul Aspinall" <pa**@aspy.co.u kwrote in message
news:nP******** **********@fe2. news.blueyonder .co.uk...
Hi
I want to have most of my website available to users without any
authentication (ie. they can freely browse). However, if they go to a
restricted part, they should be redirected to a login page, and then
authenticated.

I don't want to use SQL Server, as I would have to pay for that with my
host. I would prefer to use Access, or even a custom method.

Does anyone have any sample code, or can point me to some resource
examples?

Thanks


Oct 1 '06 #2

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

Similar topics

1
1663
by: Paul Daly (MCP) | last post by:
Background: I want to be able to authenticate users whose usernames & passwords are stored in a SQL database. I only want certain pages to require authentication. I have tried to implement this by creating the following class public class SecuredPage : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e)
3
3888
by: kevin | last post by:
hi all with forms authentication, how does that work for a site with introduction and tour or maybe some more pages? by using forms authentication, all pages have to be authenticated before viewing, but in case when only the database access page needed to be authenticated, how would forms authentication work for that? does it needed to be broke down into two asp.net apps, one authentication mode = none the other using forms ?
2
4471
by: Peter | last post by:
I have a site which uses forms authentication but I would like to exclude certain pages on the site from authentication. In other words I would like the user to be able to get to these pages without having to Log In. How do I change my web.config file to exclude certain files. <authentication mode = "Forms"> <forms name = ".ASPX" loginURL="Authenticate.aspx" protection = "All" path="/" />
3
4872
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be protected by forms authentication. When I create forms authentication at root level it works but when I move my code up to the subfolder I get this error: Server Error in '/TestProjects/FormsAuthenticationTestingArea' Application.
1
1476
by: - Steve - | last post by:
I have a directory that I want to use forms based authentication on. There's a couple of pages in that directory that I want to allow anonymous access to. There's also one page that I want to allow anonymous access to, but if someone is logged in then the page would be slightly different. How can I allow anonymous access to certain files in a Forms Based Authentication protected directory? --
5
1669
by: Samba | last post by:
Hi, I've a web application and I'm using Forms authentication. My app contains some pages that can be viewed by everyone and it doesn't require any authentication or authoization and these pages mostly come at the start of the application. After a couple of such 'general' pages, the login screen comes. How do tackle this situation? Advance thanks for throwing any light on this --
1
312
by: Kram | last post by:
Hello All, I have a asp.net 1.1 app which currently implements Forms Authentication. This all works 100% as far as I can see. But I want to change it slightly and dont know how to do it. I need for just 1 certain type of request to always allow the user to gain access to, so that no matter what, this certain page will not require the user to log in.
3
1781
by: =?Utf-8?B?TWF4IFR1cmF2YW5p?= | last post by:
Hi, Is there any way I can cause a login page to appear, using Forms authentication of course, when access a particular page only. In my case, I am building a site for rental properties. There are a group of files ( HTML, ASPX files ) that are freely publicly accessable. There are certain pages however that my client will use to update their listings and images. I would like those pages ONLY to be redirected to the login page but NOT the...
5
3569
by: Rory Becker | last post by:
Having now created a Custom MembershipProvider that seems to work correctly with my Logon and ChangePassword controls, I am, as they say, a happy bunny. The next stange is to move on to the creation of content which adjusts based on the user. I have several pages which require a user to be logged on and several which do not. Prior to this point in time I have used 2 different master pages. one with a control which checks a session...
0
9666
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
10410
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
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...
0
9020
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...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4093
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
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.