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

Masterpages problem

I have a masterpage which shows some images. When I create a content page
which is placed in the same folder with the masterpage, everything works
fine. When I put the content page in a subfolder, the URL of the picture is
invalid.

The url of the content page which is in the same directory with the master
page image is http://localhost:1778/WebSite2/Pictures/boolet.gif but the url
for the content page placed in the subfolder is
http://localhost:1778/WebSite2/Tools...res/boolet.gif. The system adds
automatically the name of the subfolder "Tools". How can I correct this
problem?

Aristotelis
Oct 23 '06 #1
3 1116
Use a asp.net imag control with ~/...name
Or use inline code with ResolveUrl( "~/...name) in your img

Your master is not the current page but it's contents are.
"Pitaridis Aristotelis" <pi*******@hotmail.comschreef in bericht
news:1161590325.531329@athnrd02...
>I have a masterpage which shows some images. When I create a content page
which is placed in the same folder with the masterpage, everything works
fine. When I put the content page in a subfolder, the URL of the picture is
invalid.

The url of the content page which is in the same directory with the master
page image is http://localhost:1778/WebSite2/Pictures/boolet.gif but the
url for the content page placed in the subfolder is
http://localhost:1778/WebSite2/Tools...res/boolet.gif. The system adds
automatically the name of the subfolder "Tools". How can I correct this
problem?

Aristotelis

Oct 23 '06 #2
The ~/... name does not work. How can I use the ResolveUrl function inside
the html?
The part of the html that I wand to correct is the following:
<img src="~/Pictures/boolet.gif" />

How can I apply the ResolveUrl function in my problem?

Aristotelis

Ï "Edwin Knoppert" <ne**@hellobasic.comÝãñáøå óôï ìÞíõìá
news:45**********************@text.nova.planet.nl. ..
>
Use a asp.net imag control with ~/...name
Or use inline code with ResolveUrl( "~/...name) in your img

Your master is not the current page but it's contents are.
"Pitaridis Aristotelis" <pi*******@hotmail.comschreef in bericht
news:1161590325.531329@athnrd02...
>>I have a masterpage which shows some images. When I create a content page
which is placed in the same folder with the masterpage, everything works
fine. When I put the content page in a subfolder, the URL of the picture
is invalid.

The url of the content page which is in the same directory with the
master page image is http://localhost:1778/WebSite2/Pictures/boolet.gif
but the url for the content page placed in the subfolder is
http://localhost:1778/WebSite2/Tools...res/boolet.gif. The system adds
automatically the name of the subfolder "Tools". How can I correct this
problem?

Aristotelis


Oct 23 '06 #3
Ok. I found it.

<img src="<%= ResolveUrl("~/Pictures/boolet.gif")%>" />

Thank you very much.

Ï "Edwin Knoppert" <ne**@hellobasic.comÝãñáøå óôï ìÞíõìá
news:45**********************@text.nova.planet.nl. ..
>
Use a asp.net imag control with ~/...name
Or use inline code with ResolveUrl( "~/...name) in your img

Your master is not the current page but it's contents are.
"Pitaridis Aristotelis" <pi*******@hotmail.comschreef in bericht
news:1161590325.531329@athnrd02...
>>I have a masterpage which shows some images. When I create a content page
which is placed in the same folder with the masterpage, everything works
fine. When I put the content page in a subfolder, the URL of the picture
is invalid.

The url of the content page which is in the same directory with the
master page image is http://localhost:1778/WebSite2/Pictures/boolet.gif
but the url for the content page placed in the subfolder is
http://localhost:1778/WebSite2/Tools...res/boolet.gif. The system adds
automatically the name of the subfolder "Tools". How can I correct this
problem?

Aristotelis


Oct 23 '06 #4

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

Similar topics

2
by: iturner100 | last post by:
Hi, I've been struggling with this one for a couple of hours without much joy. Basically, I've got a set of nested masterpages (3 as it happens). I'm dynamically generating a new page in code...
3
by: Markus Rytterkull | last post by:
I'm porting an application from asp to asp.net2.0 and thought this would be a good time to test masterpages and themes. The end result is fine but I find it difficult to recreate forms in...
5
by: Nick Wouters | last post by:
Dear All In Classic ASP I used CSS for ALL layout. Now in ASP.NET version 2 I am testing out Masterpages as they come in very handy. It seems like it is replacing CSS for layout but what is...
6
by: =?Utf-8?B?U3RlcGhlbiBIYXRmaWVsZA==?= | last post by:
I have two masterpages in a web application. One is used for the login and logout pages. The other is used for all other pages in the application. The difference between the two masterpages is...
8
by: Mort Strom | last post by:
Right now the header of my master page contains all of the CSS styles for all of the pages that might be loaded in my ContentPlaceHolder. The problem is that my <styletag is getting too large to...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.