473,786 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

path reference issue with a single masterpage and subfolders on a

There is probably some simple answer to my question, but i'm still new to
this a bit..

I have a master page.. with a menu system which is coded onto the
masterpage.aspx ... it uses A tags with hrefs etc.. the usual stuff..

I also have a sub section on the site.. where aspx files arent in the
root.. ie: /rootfiles.aspx here.. then /subsection/subfiles.aspx

The menu is fine and dandy with the usual relative references like <a
href="default.a spx" for the root page.. but when you are say
/subsection/subfiles.aspx all the menu items paths are incorrect.

So at this point i figure i have two or 3 choices.. I could one, make a
seperate masterpage in the subsection (not desired).. or.. I can just do a
search in the request.path variable for the word "subsection " and if it
exists, then dynamically change all the menu items href paths to the correct
format.. ie: if in a subsection, href becomes ./default.aspx for the root
page..

In doing this second option, it seems i have to do the same thing on the
masterpage.aspx .. as there is a <link css/file.cssreferen ce in there and
this cant be changed, only on the aspx file itself (ie: i cant reference it
in codebehind in the page load event).

Any thoughts on this? If these options are the best ones.. would it be a
bad idea to make all the menu links runat="server", so that i can access the
href property from the page load event and set all the values in that
procedure.. or would i be just as good to do all the checks in the embedded
c# code in the aspx page itself.. albeit a bit more messy but all client side?

Thanks

Jun 27 '08 #1
1 1805
For server side controls, you could also use a path such as
~/mydir/myfile.aspx (note the leading ~ symbol) to create application root
relative URLs...

Try http://msdn2.microsoft.com/en-us/library/ms178116.aspx for details...
--
Patrice
"markm75" <ma*****@discus sions.microsoft .coma écrit dans le message de
groupe de discussion : B3************* *************** **...icrosof t.com...
There is probably some simple answer to my question, but i'm still new to
this a bit..

I have a master page.. with a menu system which is coded onto the
masterpage.aspx ... it uses A tags with hrefs etc.. the usual stuff..

I also have a sub section on the site.. where aspx files arent in the
root.. ie: /rootfiles.aspx here.. then /subsection/subfiles.aspx

The menu is fine and dandy with the usual relative references like <a
href="default.a spx" for the root page.. but when you are say
/subsection/subfiles.aspx all the menu items paths are incorrect.

So at this point i figure i have two or 3 choices.. I could one, make a
seperate masterpage in the subsection (not desired).. or.. I can just do a
search in the request.path variable for the word "subsection " and if it
exists, then dynamically change all the menu items href paths to the
correct
format.. ie: if in a subsection, href becomes ./default.aspx for the root
page..

In doing this second option, it seems i have to do the same thing on the
masterpage.aspx .. as there is a <link css/file.cssreferen ce in there and
this cant be changed, only on the aspx file itself (ie: i cant reference
it
in codebehind in the page load event).

Any thoughts on this? If these options are the best ones.. would it be a
bad idea to make all the menu links runat="server", so that i can access
the
href property from the page load event and set all the values in that
procedure.. or would i be just as good to do all the checks in the
embedded
c# code in the aspx page itself.. albeit a bit more messy but all client
side?

Thanks
Jun 27 '08 #2

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

Similar topics

3
3648
by: Kali K E | last post by:
Hi, I could not understand how I can do the following things in Python. Please help me. 1. First I have to find the current directory from where the script is invoked. 2. Next I have to form a directory structure there. If the current directory in step 1 is /home/mylogin, then from there I have to build a directory structure like /home/mylogin/result
3
1781
by: Ben Allfree | last post by:
Written to normalize web server path names based on a virtual root. I propose that something equivalent to this be added to os.path ------------------------------------- import os.path import copy def vnormpath(root,path): """ Normalize a path based on a virtual root. """
2
672
by: Yang Liu | last post by:
Hi all, I have a .net windows application xx.exe, which reference a private assembly yy.dll, the property "local copy" of the yy.dll reference is automatically set to true, so the yy.dll will be copied to the output folder, which is the same folder as the xx.exe, that means when I deploy the application xx.exe, I must include the yy.dll to the same folder as the xx.exe exists in, but I want the folder that include the xx.exe(it's always...
1
1216
by: Shikari Shambu | last post by:
Hi, I have an ASP.NET application that has multiple folders (maps to directories under the rootweb). When my code tries to access a control that is under /common folder I get the following error The virtual path '/common/ErrorDiv.ascx' maps to another application, which is not allowed How do I overcome this issue. The folder and the subfolders are really part of a single application.
6
2702
by: Mirek Endys | last post by:
HEEELP!!!! I have a big problem :))))) How to use url in CSS stylesheet file that is linked into MasterPage. The tilda '~' (as shortcut to the root of the webserver) is not working, and my MasterPage is used by pages not only in root but in other subfolders. I have this in My MasterPage
13
6232
by: Michael | last post by:
I have setup a public variable in the Master Page "code-behind-file". Now I would like to set that value from the UserControl, but I can't seem to find a way to do this. Does anyone have any ideas? I'm basically trying to set it up so that I can keep the User infor (userid, ect) in the Masterpage so that other pages can access it. Thanks for any ideas. Michael
2
1027
by: Sean | last post by:
We have a Master page problem that comes around time and time at work and it’s a problem that has been confirmed by other developers on the project I have been on. Additionally I have had the exact problems happen on my personal project at home. Myself and the team I have been on are pretty experienced with master pages and themes however now it is time for us to get a deeper understanding then we have been able to find in books...
35
3232
by: Chris | last post by:
Hi, I tried to create a class which must change the propety 'visible' of a <linktag in the masterpage into 'false' when the user is logged. But i get the error: "Object reference not set to an instance of an object" for the line 'If mpg.FindControl("lkred").Visible = True Then'. I couldn't find sofar the solution. Any help would be appreciated ... Thanks
0
1040
by: saukpatthanshwe | last post by:
In myproject, there are three Master Pages under Master Folder. And I have many subfolders storing aspx pages which use that MasterPages. The Problem is that aspx pages in the root directory , the Images from Master pages cannot be seen. However, the aspx pages in the subfolders can be seen. In my masterpage, I use the table Background image and set the url as ../Images/myim.jpg . But when I change using the Image button ,the images...
0
9650
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
9497
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
10363
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
10164
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
9962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8992
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
7515
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
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4067
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

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.