473,320 Members | 1,988 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Forms authentication for certain pages

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 publicly
accessible files. Is there a way to target URL redirection using forms
authentication for certain files that you specify.

Thanks,

Max
Feb 6 '07 #1
3 1756

"Max Turavani" <Ma*********@discussions.microsoft.comwrote in message
news:C6**********************************@microsof t.com...
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
publicly
accessible files. Is there a way to target URL redirection using forms
authentication for certain files that you specify.

Thanks,

Max
Hi Max,

Just put all the files you want to protect under their own directory, and in
that directory add another web.config file specifying allow and deny.

Feb 6 '07 #2
Hi Max,

In addition to that, you can use location element:

<system.web>

<authentication mode="Forms">
<forms loginUrl="login.aspx" name="AuthCookie" path="/" timeout="20"/>
</authentication>

<!-- allow everyone too see all pages -->
<authorization>
<allow users="*"/>
</authorization>

</system.web>

<!-- restrict access to few confidential pages -->
<location path="confidentialUpdatePage1.aspx">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>

<location path="confidentialUpdatePage2.aspx">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>

--
Milosz
"news-server.maine.rr.com" wrote:
>
"Max Turavani" <Ma*********@discussions.microsoft.comwrote in message
news:C6**********************************@microsof t.com...
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
publicly
accessible files. Is there a way to target URL redirection using forms
authentication for certain files that you specify.

Thanks,

Max

Hi Max,

Just put all the files you want to protect under their own directory, and in
that directory add another web.config file specifying allow and deny.

Feb 6 '07 #3
Thanks everyone for your responses !!!
I used the location tag option and it worked like a charm !!!!

Thanks again !!!

"Milosz Skalecki [MCAD]" wrote:
Hi Max,

In addition to that, you can use location element:

<system.web>

<authentication mode="Forms">
<forms loginUrl="login.aspx" name="AuthCookie" path="/" timeout="20"/>
</authentication>

<!-- allow everyone too see all pages -->
<authorization>
<allow users="*"/>
</authorization>

</system.web>

<!-- restrict access to few confidential pages -->
<location path="confidentialUpdatePage1.aspx">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>

<location path="confidentialUpdatePage2.aspx">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>

--
Milosz
"news-server.maine.rr.com" wrote:

"Max Turavani" <Ma*********@discussions.microsoft.comwrote in message
news:C6**********************************@microsof t.com...
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
publicly
accessible files. Is there a way to target URL redirection using forms
authentication for certain files that you specify.
>
Thanks,
>
Max
Hi Max,

Just put all the files you want to protect under their own directory, and in
that directory add another web.config file specifying allow and deny.


Feb 6 '07 #4

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

Similar topics

1
by: Hugh McLaughlin | last post by:
Hello Everyone and thanks for your help in advance. I recently installed Visual Studio 2003 and .Net 1.1. I then converted one of my applications to 2003. However, I am running into a probelm...
1
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...
3
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...
2
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...
3
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...
1
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...
5
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...
1
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...
5
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.