473,765 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1482
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****@NOSPAMd evelop.com> wrote in message
news:b8******** *************** *@msnews.micros oft.com...
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
1261
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 implement htis somehow in 1.1? I have been playing with the templating solution present in the aspnet insider tricks.Migh it be possible to add the behavior to that approach somehow? Thanks Ashok
14
2405
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 standard ASPX page with minor modifications to it. All of my pages inherit from a "BasePage.cs" class, that handles common things like getting the user's information out of the session, determines if a page should or should not be password...
0
940
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 what not to navigate through a ton of html reports that are created with a different application... Right now, all I have are redirects to the html page... depending on dropdownlist and calendar selection
3
1635
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 backwards: Content page, SubMaster Page, Master Page. Does this seem messed up to anyone else?? I can't see any logic in this. But from what I understand, the whole master page scheme is cooked on top of the usercontrol class. So the...
2
3749
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 page do NOT appear in any of the web forms located in my Secure dir, however, any forms off the root of my web app will display the master page with the graphics. Is there some trick to get master pages to work with forms authentication of forms...
2
7026
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 header. I tried to put the link tag in the Master page, but the classes are not recognized in the Content Page. How do I use a StyleSheet with the Content Page? TIA
17
4616
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 one calls it) All I want to do is show a Google map on the slave page. The map that Google gives as an example when it gives you a key would be just fine. I have searched high and low for a means of doing this but all I could find
3
6357
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 page so that this will be displayed on all the content pages automatically. This works fine for the content pages that are stored in the same
0
1644
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 folder structure is as follows: Test Folder Test.aspx (normal webform) Test2.aspx (content page) ctlCalendar.ascx
0
9568
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
9404
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
10007
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
9959
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
8833
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
6649
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3926
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
3532
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.