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

Master pages and Redirects & paths?

I'm using a single Master page.

I'm having some strange results using Redirects in master pages using
relative pathing i.e ~. I'm using Form authentication and whenever I
navigate to my Login form (under a different dir called Secure) and then
navigate back to my main form under root dir and then try to navigate to
another form at the root dir level, it will look for the aspx page under the
"Secure" dir rather than my root dir??

example (navigation route):
MyWeb/Main.aspx --> ~/Secure/Login.aspx --> MyWeb/Main.aspx -->
MyWeb/PrivaceyPolicy.aspx

what actually happens
MyWeb/Main.aspx --> ~/Secure/Login.aspx --> MyWeb/Main.aspx -->
MyWeb/Secure/PrivaceyPolicy.aspx

As soon as I navigate to my /Secure/Login.aspx all my pathing in redirects
seem to get the dir "Secure" injected into the path?? I've tried using ~/
but that results in MyWeb/~/PrivaceyPolicy.aspx.

Any suggestions?

Rob.
May 31 '06 #1
2 1465
Anytime you reference external URLs/links/resources form the master, you
need to keep in mind that the reference is relative to the page being requisted,
not relative to the location of the .master itself. So the typical solution
to this is to always use app-relative references using the ~/path syntax,
where "~" is magic for "the root of my application" and then you reference
the resource you need from the top down.

-Brock
http://staff.develop.com/ballen

I'm using a single Master page.

I'm having some strange results using Redirects in master pages using
relative pathing i.e ~. I'm using Form authentication and whenever I
navigate to my Login form (under a different dir called Secure) and
then navigate back to my main form under root dir and then try to
navigate to another form at the root dir level, it will look for the
aspx page under the "Secure" dir rather than my root dir??

example (navigation route):
MyWeb/Main.aspx --> ~/Secure/Login.aspx --> MyWeb/Main.aspx -->
MyWeb/PrivaceyPolicy.aspx
what actually happens
MyWeb/Main.aspx --> ~/Secure/Login.aspx --> MyWeb/Main.aspx -->
MyWeb/Secure/PrivaceyPolicy.aspx
As soon as I navigate to my /Secure/Login.aspx all my pathing in
redirects seem to get the dir "Secure" injected into the path?? I've
tried using ~/ but that results in MyWeb/~/PrivaceyPolicy.aspx.

Any suggestions?

Rob.

Jun 1 '06 #2
Thank you, got it working.

"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:b8************************@msnews.microsoft.c om...
Anytime you reference external URLs/links/resources form the master, you
need to keep in mind that the reference is relative to the page being
requisted, not relative to the location of the .master itself. So the
typical solution to this is to always use app-relative references using
the ~/path syntax, where "~" is magic for "the root of my application" and
then you reference the resource you need from the top down.

-Brock
http://staff.develop.com/ballen

I'm using a single Master page.

I'm having some strange results using Redirects in master pages using
relative pathing i.e ~. I'm using Form authentication and whenever I
navigate to my Login form (under a different dir called Secure) and
then navigate back to my main form under root dir and then try to
navigate to another form at the root dir level, it will look for the
aspx page under the "Secure" dir rather than my root dir??

example (navigation route):
MyWeb/Main.aspx --> ~/Secure/Login.aspx --> MyWeb/Main.aspx -->
MyWeb/PrivaceyPolicy.aspx
what actually happens
MyWeb/Main.aspx --> ~/Secure/Login.aspx --> MyWeb/Main.aspx -->
MyWeb/Secure/PrivaceyPolicy.aspx
As soon as I navigate to my /Secure/Login.aspx all my pathing in
redirects seem to get the dir "Secure" injected into the path?? I've
tried using ~/ but that results in MyWeb/~/PrivaceyPolicy.aspx.

Any suggestions?

Rob.


Jun 1 '06 #3

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

Similar topics

6
by: Showjumper | last post by:
In asp.net 2.0, when using master pages the paths to images, styles sheets etc get fixed appropriately depeing on whether the child page is in a subfolder or not. How does master pages do it? Cani...
14
by: multiformity | last post by:
So I have been working on an opensource project for a while, and decided to really try to make it look better after focusing on the functionality most of this time. Up to now, I have simply used a...
0
by: newsgroups.jd | last post by:
Looking for some options and suggestions on how to proceed - any advice is appreciated and thank you in advance... I have created a master page that has multiple dropdownlists and calendar and...
3
by: Brian | last post by:
Master pages run Page_Load() from the deepest level of nesting outwards. So if I write a content page based on a nested master which is then based on some other master, the Page_Loads are executed...
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...
2
by: SR | last post by:
I have started a web site using ASP.NET 2.0. I would like to centralize all of my classes in a StyleSheet but I cannot figure out how to link the StyleSheet to a Content Page since there is no...
17
by: MeerkatInFrance | last post by:
There comes a time when you know you are not going to be able to work something out yourself, however hard you try. I have reached that moment. I have a master page and a slave page (or whatever...
3
by: vikramp | last post by:
Hi, I am still new to ASP.NET 2.0 and trying to develope something using Master pages. My problem is: I have a master page that contains Logo image and a navigation menu at the top of the...
0
by: jediknight | last post by:
I have a simple project where there is a master page called MasterPage.master and some webforms which are content pages. I also have a usercontrol which is a simple calendar control popup. The...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.