473,397 Members | 1,974 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,397 software developers and data experts.

Master pages and Forms Authorization

I'd like to use a master page for (nearly) every page in my ASP.NET 2.0
website.

I also have some webpages that I'd like to protect by using forms
authorization.

I have a page that requires authenticated users, so I've dropped it in a
virtual application with a web.config that denies access to anonymous users
like so:

<authorization>
<allow users="*" />
<deny users="?" />
</authorization>

This page also uses the global master page which resides at the root level.

Trying to load this page results in an exception:

The virtual path '/MasterPage.master' maps to another application, which is
not allowed.

Is this really by design? It's a real bummer when two great new features
don't play well with each other. Am I missing something here? Can I
utilize forms authorization without putting my protected pages in a virtual
application? Alternatively, is there a way to use a single master page in
several virtual applications?

thanks

-ivan.
Mar 26 '06 #1
1 2118
On Sat, 25 Mar 2006 22:15:54 -0600, gilly3 wrote:
I'd like to use a master page for (nearly) every page in my ASP.NET 2.0
website.
Ok.
I also have some webpages that I'd like to protect by using forms
authorization.
Ok.
I have a page that requires authenticated users, so I've dropped it in a
virtual application with a web.config that denies access to anonymous users
like so:
Why? You don't have to specify a new web application to protect just a few
pages. You can specificy protection of individual pages in the location
section of the web.config.
<authorization>
<allow users="*" />
<deny users="?" />
</authorization>


As a side note, this won't work. This will allow all users, all the time.
You want to reverse the order of those, since asp will take the first valid
condition and apply it, in this case allow all users. Reverse it so that
unauthenticated users are denied first.
Mar 26 '06 #2

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

Similar topics

2
by: Eric | last post by:
I am trying to build an app where the stuff in the root directory is open to all, but anything under the Restricted directory requires you to login and I want to use Forms to do it. I'm having...
2
by: Shimon Sim | last post by:
I am creating application that is mostly is used by registered user. I am using Form security to let user in. I also need to create registration for users. This of cause has to be accessible to...
4
by: MR. UNDERHILL | last post by:
I want to use forms authentication on my website. Looking at the documentation, I create a sample site for testing. One of my requirements is to ensure that SOME pages required an authenticated...
2
by: Oldman | last post by:
I am using ASP .NET 2.0, VS2005 Professional RTM. I added a master page to my web application and made my default page refer to it. I then proceeded to theme some elements in the master page....
3
by: Adam J Knight | last post by:
Hi all, I have an app that mostly requires authentication. However there are a couple of pages that don't require authentication.. What do i need in my web.config, to specify these pages...
17
by: Rob R. Ainscough | last post by:
Again another simple concept that appears NOT to be intuitive or I'm just stupid. I've read the WROX book and the example doesn't actually show how the .master page links in the other content...
2
by: Rob R. Ainscough | last post by:
I'm using forms authentication along with Master pages -- my authenticated forms reside is a sub-dir (Secure) below the web site root dir. The problem is that any graphics placed on the Master...
3
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...
1
by: mshiva | last post by:
hi friends i want to open a login page first even for accessing any other pages in the application. my code in web.config: <authentication mode="Forms"> <forms loginUrl="~/Pages/login.aspx" ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
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,...

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.