473,326 Members | 2,126 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,326 software developers and data experts.

Master Pages and content pages in subfolder

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
folder as that of Master page.

But I have a content page that is stored in a sub-folder (not in the
same folder as that of master page). Because of this, the contents
inherited from the master page (images/hyperlinks on master page) are
not rendered on content page. The reason being their relative paths
become invalid as my content page is inside a sub-folder.

How to resolve this issue? Do I have to mention the path for images
(and other relative paths) on master page using some different
technique (using ~ or something of that sort?)
thanks.

Oct 13 '06 #1
3 6288
"vikramp" <vp****@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
How to resolve this issue? Do I have to mention the path for images
(and other relative paths) on master page using some different
technique (using ~ or something of that sort?)
Do yourself a *HUGE* favour and design your web app so that everything is at
the same level off the root, e.g.

<root>
\bin
\css
<stylesheets go here>
\folder 1
<content goes here>
\folder 2
<content goes here>
\folder n
<content goes here>
\includes
<include files e.g. JavaScript etc go here>
\master
<master pages go here>
default.aspx
Global.asax
Web.config
Oct 13 '06 #2
vikramp wrote:
But I have a content page that is stored in a sub-folder (not in the
same folder as that of master page). Because of this, the contents
inherited from the master page (images/hyperlinks on master page) are
not rendered on content page. The reason being their relative paths
become invalid as my content page is inside a sub-folder.
<img runat="server" src="~/images/my-pic.jpg" />

Oct 13 '06 #3
Hi apathetic,

thanks for the solution. It worked fine using ~ to specify the path.
apathetic wrote:
vikramp wrote:
But I have a content page that is stored in a sub-folder (not in the
same folder as that of master page). Because of this, the contents
inherited from the master page (images/hyperlinks on master page) are
not rendered on content page. The reason being their relative paths
become invalid as my content page is inside a sub-folder.

<img runat="server" src="~/images/my-pic.jpg" />
Oct 13 '06 #4

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

Similar topics

5
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the...
1
by: Alan Silver | last post by:
Hello, I am just experimenting with master pages, and am trying to add a content placeholder in the <head> section, so that individual pages can set their own page title and meta tags. The...
1
by: michael.bollhoefer | last post by:
I was running into issues with the images on the page not working under sub folders. If you leave a master file in the root folder and place content pages in the subfolder then when you hit a...
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...
3
by: Laith Zraikat | last post by:
I need to set the page title for a content page in a master page, and do that using local reources so that I can have my page title in different languages. I can do that easily using global...
0
by: romaricr | last post by:
Hello, We are having issues with namespaces. Here is what we do: - We set a namespace for our project and pages (something like 'group.project.component.folder.subfolder.page) - We add a...
1
by: jobs | last post by:
I've got an asp.net 2.0 website that has a master page and content pages. For announcemnts, users modifiy plain old html pages that I then can bring into a div tag of a content page using the...
16
by: IfThenElse | last post by:
Hi, I have a web page in a subfolder that inherits a Master page at the root. the webpage in the subfolder can not see the Master page. This is what I have in my ...
3
by: shiyas | last post by:
I have an aspx page named PartSearch.aspx. This is in root directory. I want to popup this page using window.showModalDialog from master page (by clicking a Hyperlink in master page) . So from master...
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
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...
1
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.