Problems with link using masterpages (Full Version)

All Forums >> [Web Development] >> General Web Development



Message


toppas -> Problems with link using masterpages (5/2/2007 12:34:47)

I have problems doing the following

1. I create an ASP.NET Masterpage
2. Ich create a new page from the Masterpage

I don't get any problems with my links and included pictures, if the new page is in the same directory as the masterpage.

My problems are, that if I don't save the new page in the same directory as my masterpage, than all of my links and included pictures don't work on the new page.

Is the problem clear?
Is there a solution for this problem, cause I don't want to put all my pages in the same directory.

Thank You




Mike54 -> RE: Problems with link using masterpages (5/2/2007 13:33:02)

Try using the absolute path when creating your links and adding your images...

'http://www.yoursitename/docs/link.ht__'
'http://www.yoursitename/images/picture.jp_'

I ran into a similar problem trying to integrate a forum to a site and found that for some reason EW couldn't get the relative (../../images/picture.jp_) path straight to my images until I used the full path.[&o] Of course the other problem was that when I made changes to the page it reverted back to relative so it may not be so simple.[&:]




toppas -> RE: Problems with link using masterpages (5/3/2007 4:27:36)

Thank you for the answer. It seems to be a solution to use the absolute path, but I would rather say, that this is a bug in the software. I hope, that Microsoft will fix this problem soon.

The interesting thing is, that I can use the relative path for my .css styles

Waiting for further answers
Tobi




Reflect -> RE: Problems with link using masterpages (5/3/2007 7:44:19)

You can also use /images/whatever.jpg it will work the same as the full distinguished path.

By using ../../ type scenario the path will break when placing the template in directories that have more steps back to the root or fewer steps back to the root.

Now I have NOT used EW yet. However this was the same in FP version X.X. I would actually have to save the file into said directory. When I did it would correct all paths in the XHTML page automatically. I have never used "Master pages" though. Give it a try and see what happens, it couldn't hurt if it fails [;)].

<edit>
quote:

The interesting thing is, that I can use the relative path for my .css styles.


Check the code in code view. Compare that to another page in a different level directory. It most likely is auto correcting the path statement. This is normal behavior.
</edit>

Take care,

Brian




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875