CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 5/9/2005 2:30:25 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 21 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
Geminiman
Asp.Net User
Pathing with Masterpages nightmare5/9/2005 2:30:25 PM

0/0

Ok, so I'm using master pages and I love it. But the problem is that the pathing changes for subdirectories like crazy so images and links and everything have to be root pathed. Which would be fine if I could get the development server to load my project up in the root, but I can't figure out how to make it do that.

Is there some way to do relative pathing to the root of the project al-la the ~ in the page headers etc?

Thanks!

BrockAllen
Asp.Net User
Re: Pathing with Masterpages nightmare5/9/2005 3:43:14 PM

0/0

 Geminiman wrote:

Is there some way to do relative pathing to the root of the project al-la the ~ in the page headers etc?

Yes, use the "~" syntax. This will build a path that's relative to the root of the application (not the site). Since you know about "~", what problems do you sem to be running into when trying to use it?

-Brock

 


DevelopMentor
http://staff.develop.com/ballen
Geminiman
Asp.Net User
Re: Pathing with Masterpages nightmare5/9/2005 4:35:32 PM

0/0

If I use the ~ in an image path, it doesn't work:

<img src="~/Images/SomeImage.jpg">

results in this in the source of the page viewed from the browser:

http://localhost:90/WebSite/Products/~/Images/CenterTopCenter.jpg

when I right click on the image that isn't displaying correctly.

Basically because I have a single master page, and all of my other pages will be in different directories (i.e. Products, or KB or whatever) the pathing changes, so I cant' use relative pathing in the master page. I have to use absolute pathing. The problem is that in development mode I cna't make the development server start up with my project in the root of the development web server, so I can't use absolute pathing because it will be all wrong when I move it to a real IIS server.

This is a major problem with Master Pages because the pathing changes constantly. 

Does anyone have a work around?

I either need to work around the pathing to make it absolute to the root of the project, not the web server, or I need to be able to get the development web server that Vs.net 2005 starts to load my project in the root of it.  Either would be greatly appreciated :)

Thanks!

tinghaoy
Asp.Net User
Re: Pathing with Masterpages nightmare5/9/2005 8:18:55 PM

0/0

<img src="xxx" is a just a HTML element, the url will not be rebased correctly for the server-side resources. To fix this add runat=server to make it a server-side control so the resources can be mapped correctly. For example:

<img runat=server src="~/Images/SomeImage.jpg">

HTH,

Ting-hao

 


This posting is provided "AS IS" with no warranties, and confers no rights.
Geminiman
Asp.Net User
Re: Pathing with Masterpages nightmare5/9/2005 9:03:50 PM

0/0

Thanks! works like a charm! Only problem is that it changes my ID values and screws with the CSS, but I'll live :)

5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
ASP.NET 2.0: Your Visual Blueprint for Developing Web Applications Authors: Chris Love, Pages: 339, Published: 2007
ASP.NET AJAX Programming Tricks Authors: Matthew David Ellis, Matthew Ellis, Pages: 388, Published: 2007
The InDesign Effects Book Authors: Ted LoCascio, Pages: 260, Published: 2005

Web:
Pathing with Masterpages nightmare - ASP.NET Forums Re: Pathing with Masterpages nightmare. 05-09-2005, 11:43 AM. Contact ... Re: Pathing with Masterpages nightmare. 05-09-2005, 12:35 PM ...
Master Pages, Themes and Navigation Controls - ASP.NET Forums Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages by Jacob J. Sanford ... Pathing with Masterpages nightmare by Geminiman. No Status ...
MSDN SharePoint - Development and Programming Changing the master ... I have been trying to reference the master page into the CreateWebPage.aspx file but unable to do so. I am not sure what path I need to give in that file. ...
Hannah Scott's Blog: April 2007 ...
Stramit's SharePoint Blog[FeedShow RSS reader] In fact, i just add a new path on my subsite masterpage gallery. ... if you have never use a PPC in a intranet mode, it could become a real nightmare . ...
View Differences ... page dedicated to MasterPages and Themes in SharpForge. ... way to integrate with SharpForge so that upgrades aren't a nightmare +If you get in ...
TheMSsForum.com >> Portal Server >> SSO Nightmare! - The Microsoft ... I created Custom workflow. when i am starting my workflow i am getting fallowing msg virtual path /_catalogs/masterpage/default.master maps ...
Online Instruction Center Do the terms Master Page and Text Flow make you want to quake? ... In this lesson, you’ll learn how to avoid nightmares like this by using FrameMaker’s ...
Inside Microsoft: Back Seat Driver November 2002 (Free Article) The Tag-based approach is best demonstrated by the Master Pages project, created by the .... Just think of the maintenance nightmare that you are creating. ...
Introduction to SQL Server Reporting Services We specify the path where this is going to reside and that we are going to use the .... MasterPages are a great addition to the ASP.NET 2.0 feature set, ...




Search This Site:










master page & authentication

can't call selectsinglenode on sitemap xml

changing the id attribute of the body tag in a masterpage?

nested master page and css

how do i set "visited page" css when using masterpages

load page outside of website into master page control

navigation menu

programmatically adding controls to asp:content

multiple menus

sitemap provider - depth of an url

dynamic urls in menu control

get checked value from treeview with checkbox

how to map sub domain and sub folders with themes (asp.net 2.0)

multview - remembering the setactiveview on post back.

question about roles attribute

when i modify an aspx file,the theme property will disappear.why?

accessing controls in content area

menu style problem

theme and datagrid not working

how to get focus back to the scroll position on post back

problems with css - site looks different in ie and firefox

popup calendar problem

share master pages between projects and have design time rendering

button click event fires after master pae has rendered

share the same masterpage file between different websites? (newbie)

centre aligning a table to hold my webpages

addnode not working when url is empty

how do i style treeview control?

asp:sitemappath print style

how to disable menu items

  Privacy | Contact Us
All Times Are GMT