![]() |
|
|
#1 |
|
Guest
Posts: n/a
|
Image from Master Page not shown on Pages in Subdirectories
I am developing a new web site, using ASP.Net pages.
The root directory contains the master page (master.master), the home page (default.aspx), a folder for styles and a folder with a few images (images). All other pages are in sub-directories, beginning with a folder 'Continents' which, of course, also is located in the root directory. The master.master page contains an image, which is located in the folder 'images'. It shows fine in default.aspx. None of the other pages, located in 'Continents', or subfolders of 'Continents' show the image. Viewing any of those pages in a browser & clicking on the little white square with red X & selecting properties, it is obvious why: the page is looking for the image in folder '(root)/Continents/subfolders..../images', which in general might or might not exist. How can I force the subpages to look for the image in '(root)/images'? Puting all sub-pages (about 30 or so) into the root folder would lead to a very poor organization & putting a folder 'images' with that image into all subfolders is equally destructive. I am surprised that Expression Web does not automatically redirects the sub-pages to get the image from the image folder in the root directory. Unfortunately, one cannot do this via a code correction, since the code for the sub pages just refers to master.master & only adds the local content. Any help would be appreciated. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Re: Image from Master Page not shown on Pages in Subdirectories
Either use a asp.NET image control, instead of an HTML image, or use
root relative links. A root relative link (to an image) would be similar to: <img src="/images/pic.jpg" height="30" width="20" alt="sample image" /> Using the image control will produce code similar to <asp:Image id="Image1" runat="server" alternatetext="sample image" height="30px" imageurl="~/images/pic.jpg" width="20px" /> Where the ~/images refers to the images folder at the application root, which is often (but not always) the website root. -- Ron Symonds - Microsoft MVP (FrontPage) Reply only to group - emails will be deleted unread. http://www.rxs-enterprises.org/fp "Peter K" <PeterK@discusions.microsoft.com> wrote in message news:17D5E5D3-5045-4706-9EEA-731BFCB07ABF@microsoft.com: > I am developing a new web site, using ASP.Net pages. > > The root directory contains the master page (master.master), the home page > (default.aspx), a folder for styles and a folder with a few images (images). > All other pages are in sub-directories, beginning with a folder 'Continents' > which, of course, also is located in the root directory. > > The master.master page contains an image, which is located in the folder > 'images'. > > It shows fine in default.aspx. None of the other pages, located in > 'Continents', or subfolders of 'Continents' show the image. Viewing any of > those pages in a browser & clicking on the little white square with red X & > selecting properties, it is obvious why: the page is looking for the image > in folder '(root)/Continents/subfolders..../images', which in general might > or might not exist. How can I force the subpages to look for the image in > '(root)/images'? > > Puting all sub-pages (about 30 or so) into the root folder would lead to a > very poor organization & putting a folder 'images' with that image into all > subfolders is equally destructive. > > I am surprised that Expression Web does not automatically redirects the > sub-pages to get the image from the image folder in the root directory. > Unfortunately, one cannot do this via a code correction, since the code for > the sub pages just refers to master.master & only adds the local content. > > Any help would be appreciated. |
|
|
|
#3 |
|
Guest
Posts: n/a
|
RE: Image from Master Page not shown on Pages in Subdirectories
Just to elaborate on the solutions you were given by Ron ... This is not a EW
issue. ASP.NET pages are created on the fly, on the server, using that single ..master page, and EW is out of the picture at that point, which is why you need to use a solution that ASP.NET understands. This is in contrast to using DWTs to create static pages, as these are created locally at design time, where EW can and does manage relative paths for each page created. "Peter K" wrote: > I am developing a new web site, using ASP.Net pages. .... > I am surprised that Expression Web does not automatically redirects the > sub-pages to get the image from the image folder in the root directory. > Unfortunately, one cannot do this via a code correction, since the code for > the sub pages just refers to master.master & only adds the local content. |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Re: Image from Master Page not shown on Pages in Subdirectories
Sorry but your realtive path idea doesn't work if you call child pages from
directories other than the root. I had the same problem. The problem occurs when calling webpages on different levels of the website. The example " A root relative link (to an image) would be similar to: <img src="/images/pic.jpg" height="30" width="20" alt="sample image" />" doesn't work for a child page called from say .../../topic_folder/webpage.aspx" for example and not just .../webpagetop_folder/webpage.aspx In fact, the code above <img src="/images/pic.jpg" height="30" width="20" alt="sample image" />" shouldn't have the " /" before the folder "images" to work Using .net 2.0 and "Using the image control will produce code similar to <asp:Image id="Image1" runat="server" alternatetext="sample image" height="30px" imageurl="~/images/pic.jpg" width="20px" /> The ~/ in the path tells the compiler to use the root directory and put in the proper full path in the compiled webpage so you don't have to. The same goes for navigation menu items in html and asp .net. ds "Ronx" <ronx917@hotmail.com> wrote in message news:OSFJBcDjIHA.4076@TK2MSFTNGP05.phx.gbl... > Either use a asp.NET image control, instead of an HTML image, or use root > relative links. > > A root relative link (to an image) would be similar to: > <img src="/images/pic.jpg" height="30" width="20" alt="sample image" /> > > Using the image control will produce code similar to > <asp:Image id="Image1" runat="server" alternatetext="sample image" > height="30px" imageurl="~/images/pic.jpg" width="20px" /> > > Where the ~/images refers to the images folder at the application root, > which is often (but not always) the website root. > -- > Ron Symonds - Microsoft MVP (FrontPage) > Reply only to group - emails will be deleted unread. > > http://www.rxs-enterprises.org/fp > > > > > "Peter K" <PeterK@discusions.microsoft.com> wrote in message > news:17D5E5D3-5045-4706-9EEA-731BFCB07ABF@microsoft.com: > >> I am developing a new web site, using ASP.Net pages. >> >> The root directory contains the master page (master.master), the home >> page >> (default.aspx), a folder for styles and a folder with a few images >> (images). >> All other pages are in sub-directories, beginning with a folder >> 'Continents' >> which, of course, also is located in the root directory. >> >> The master.master page contains an image, which is located in the folder >> 'images'. >> >> It shows fine in default.aspx. None of the other pages, located in >> 'Continents', or subfolders of 'Continents' show the image. Viewing any >> of >> those pages in a browser & clicking on the little white square with red X >> & >> selecting properties, it is obvious why: the page is looking for the >> image >> in folder '(root)/Continents/subfolders..../images', which in general >> might >> or might not exist. How can I force the subpages to look for the image >> in >> '(root)/images'? >> >> Puting all sub-pages (about 30 or so) into the root folder would lead to >> a >> very poor organization & putting a folder 'images' with that image into >> all >> subfolders is equally destructive. >> >> I am surprised that Expression Web does not automatically redirects the >> sub-pages to get the image from the image folder in the root directory. >> Unfortunately, one cannot do this via a code correction, since the code >> for >> the sub pages just refers to master.master & only adds the local >> content. >> >> Any help would be appreciated. > > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
Re: Image from Master Page not shown on Pages in Subdirectories
Root relative /folder/file will always work regardless of folder since it is
the path from the website root. What it will not do is show the image in design view. For ASP.NET image controls the ~ before the / means from the application root which is usually the same as the website root though it could be different. -- Cheryl D Wise MS MVP Expression Author: Foundations of Microsoft Expression Web http://by-expression.com mail list: http://groups.google.com/group/by-ex...n-web-designer "d. smith" <dsmith@performance-plus.ca> wrote in message news:%23HO6YY0jIHA.5820@TK2MSFTNGP04.phx.gbl... > Sorry but your realtive path idea doesn't work if you call child pages > from directories other than the root. > > I had the same problem. The problem occurs when calling webpages on > different levels of the website. > > The example " A root relative link (to an image) would be similar to: > <img src="/images/pic.jpg" height="30" width="20" alt="sample image" />" > > doesn't work for a child page called from say > ../../topic_folder/webpage.aspx" for example and not just > ../webpagetop_folder/webpage.aspx > > In fact, the code above <img src="/images/pic.jpg" height="30" width="20" > alt="sample image" />" shouldn't have the " /" before the folder "images" > to work > > Using .net 2.0 and "Using the image control will produce code similar to > <asp:Image id="Image1" runat="server" alternatetext="sample image" > height="30px" imageurl="~/images/pic.jpg" width="20px" /> > > The ~/ in the path tells the compiler to use the root directory and put in > the proper full path in the compiled webpage so you don't have to. The > same goes for navigation menu items in html and asp .net. > > ds > > "Ronx" <ronx917@hotmail.com> wrote in message > news:OSFJBcDjIHA.4076@TK2MSFTNGP05.phx.gbl... >> Either use a asp.NET image control, instead of an HTML image, or use root >> relative links. >> >> A root relative link (to an image) would be similar to: >> <img src="/images/pic.jpg" height="30" width="20" alt="sample image" /> >> >> Using the image control will produce code similar to >> <asp:Image id="Image1" runat="server" alternatetext="sample image" >> height="30px" imageurl="~/images/pic.jpg" width="20px" /> >> >> Where the ~/images refers to the images folder at the application root, >> which is often (but not always) the website root. >> -- >> Ron Symonds - Microsoft MVP (FrontPage) >> Reply only to group - emails will be deleted unread. >> >> http://www.rxs-enterprises.org/fp >> >> >> >> >> "Peter K" <PeterK@discusions.microsoft.com> wrote in message >> news:17D5E5D3-5045-4706-9EEA-731BFCB07ABF@microsoft.com: >> >>> I am developing a new web site, using ASP.Net pages. >>> >>> The root directory contains the master page (master.master), the home >>> page >>> (default.aspx), a folder for styles and a folder with a few images >>> (images). >>> All other pages are in sub-directories, beginning with a folder >>> 'Continents' >>> which, of course, also is located in the root directory. >>> >>> The master.master page contains an image, which is located in the folder >>> 'images'. >>> >>> It shows fine in default.aspx. None of the other pages, located in >>> 'Continents', or subfolders of 'Continents' show the image. Viewing any >>> of >>> those pages in a browser & clicking on the little white square with red >>> X & >>> selecting properties, it is obvious why: the page is looking for the >>> image >>> in folder '(root)/Continents/subfolders..../images', which in general >>> might >>> or might not exist. How can I force the subpages to look for the image >>> in >>> '(root)/images'? >>> >>> Puting all sub-pages (about 30 or so) into the root folder would lead to >>> a >>> very poor organization & putting a folder 'images' with that image into >>> all >>> subfolders is equally destructive. >>> >>> I am surprised that Expression Web does not automatically redirects the >>> sub-pages to get the image from the image folder in the root directory. >>> Unfortunately, one cannot do this via a code correction, since the code >>> for >>> the sub pages just refers to master.master & only adds the local >>> content. >>> >>> Any help would be appreciated. >> >> > > |
|
|
|
#6 |
|
Guest
Posts: n/a
|
Re: Image from Master Page not shown on Pages in Subdirectories
Root relative paths do work - I use them in every page, asp.Net and
otherwise. Other Comments below -- Ron Symonds - Microsoft MVP (FrontPage) Reply only to group - emails will be deleted unread. http://www.rxs-enterprises.org/fp "d. smith" <dsmith@performance-plus.ca> wrote in message news:#HO6YY0jIHA.5820@TK2MSFTNGP04.phx.gbl: > Sorry but your realtive path idea doesn't work if you call child pages from > directories other than the root. > > I had the same problem. The problem occurs when calling webpages on > different levels of the website. > > The example " A root relative link (to an image) would be similar to: > <img src="/images/pic.jpg" height="30" width="20" alt="sample image" />" > > doesn't work for a child page called from say > ../../topic_folder/webpage.aspx" for example and not just > ../webpagetop_folder/webpage.aspx Why? The images folder is still in the root folder - /images/pic.jpg does not move when the calling page is moved to a different level, which is what you seem to be saying. > > In fact, the code above <img src="/images/pic.jpg" height="30" width="20" > alt="sample image" />" shouldn't have the " /" before the folder "images" to > work Why? Root relative links MUST have the leading /, or they would be relative links. Relative links have to be changed for every folder level. > > Using .net 2.0 and "Using the image control will produce code similar to > <asp:Image id="Image1" runat="server" alternatetext="sample image" > height="30px" imageurl="~/images/pic.jpg" width="20px" /> > > The ~/ in the path tells the compiler to use the root directory and put in > the proper full path in the compiled webpage so you don't have to. The same > goes for navigation menu items in html and asp .net. Which is why I suggested the .net image control. ~/ only works in asp.NET controls - it will not work in plain html. > ds > > "Ronx" <ronx917@hotmail.com> wrote in message > news:OSFJBcDjIHA.4076@TK2MSFTNGP05.phx.gbl... > > Either use a asp.NET image control, instead of an HTML image, or use root > > relative links. > > > > A root relative link (to an image) would be similar to: > > <img src="/images/pic.jpg" height="30" width="20" alt="sample image" /> > > > > Using the image control will produce code similar to > > <asp:Image id="Image1" runat="server" alternatetext="sample image" > > height="30px" imageurl="~/images/pic.jpg" width="20px" /> > > > > Where the ~/images refers to the images folder at the application root, > > which is often (but not always) the website root. > > -- > > Ron Symonds - Microsoft MVP (FrontPage) > > Reply only to group - emails will be deleted unread. > > > > http://www.rxs-enterprises.org/fp > > > > > > > > > > "Peter K" <PeterK@discusions.microsoft.com> wrote in message > > news:17D5E5D3-5045-4706-9EEA-731BFCB07ABF@microsoft.com: > > > >> I am developing a new web site, using ASP.Net pages. > >> > >> The root directory contains the master page (master.master), the home > >> page > >> (default.aspx), a folder for styles and a folder with a few images > >> (images). > >> All other pages are in sub-directories, beginning with a folder > >> 'Continents' > >> which, of course, also is located in the root directory. > >> > >> The master.master page contains an image, which is located in the folder > >> 'images'. > >> > >> It shows fine in default.aspx. None of the other pages, located in > >> 'Continents', or subfolders of 'Continents' show the image. Viewing any > >> of > >> those pages in a browser & clicking on the little white square with red X > >> & > >> selecting properties, it is obvious why: the page is looking for the > >> image > >> in folder '(root)/Continents/subfolders..../images', which in general > >> might > >> or might not exist. How can I force the subpages to look for the image > >> in > >> '(root)/images'? > >> > >> Puting all sub-pages (about 30 or so) into the root folder would lead to > >> a > >> very poor organization & putting a folder 'images' with that image into > >> all > >> subfolders is equally destructive. > >> > >> I am surprised that Expression Web does not automatically redirects the > >> sub-pages to get the image from the image folder in the root directory. > >> Unfortunately, one cannot do this via a code correction, since the code > >> for > >> the sub pages just refers to master.master & only adds the local > >> content. > >> > >> Any help would be appreciated. > > > > |
|
|
|
#7 |
|
Guest
Posts: n/a
|
Re: Image from Master Page not shown on Pages in Subdirectories
Root relative will show the images in design view if working on a server
based website (such as a development server). -- Ron Symonds - Microsoft MVP (FrontPage) Reply only to group - emails will be deleted unread. http://www.rxs-enterprises.org/fp "Cheryl D Wise" <nomail@wiserways.com> wrote in message news:et6IOY1jIHA.4244@TK2MSFTNGP06.phx.gbl: > Root relative /folder/file will always work regardless of folder since it is > the path from the website root. What it will not do is show the image in > design view. For ASP.NET image controls the ~ before the / means from the > application root which is usually the same as the website root though it > could be different. > > -- > Cheryl D Wise > MS MVP Expression > Author: Foundations of Microsoft Expression Web > http://by-expression.com > mail list: http://groups.google.com/group/by-ex...n-web-designer > > > "d. smith" <dsmith@performance-plus.ca> wrote in message > news:%23HO6YY0jIHA.5820@TK2MSFTNGP04.phx.gbl... > > Sorry but your realtive path idea doesn't work if you call child pages > > from directories other than the root. > > > > I had the same problem. The problem occurs when calling webpages on > > different levels of the website. > > > > The example " A root relative link (to an image) would be similar to: > > <img src="/images/pic.jpg" height="30" width="20" alt="sample image" />" > > > > doesn't work for a child page called from say > > ../../topic_folder/webpage.aspx" for example and not just > > ../webpagetop_folder/webpage.aspx > > > > In fact, the code above <img src="/images/pic.jpg" height="30" width="20" > > alt="sample image" />" shouldn't have the " /" before the folder "images" > > to work > > > > Using .net 2.0 and "Using the image control will produce code similar to > > <asp:Image id="Image1" runat="server" alternatetext="sample image" > > height="30px" imageurl="~/images/pic.jpg" width="20px" /> > > > > The ~/ in the path tells the compiler to use the root directory and put in > > the proper full path in the compiled webpage so you don't have to. The > > same goes for navigation menu items in html and asp .net. > > > > ds > > > > "Ronx" <ronx917@hotmail.com> wrote in message > > news:OSFJBcDjIHA.4076@TK2MSFTNGP05.phx.gbl... > >> Either use a asp.NET image control, instead of an HTML image, or use root > >> relative links. > >> > >> A root relative link (to an image) would be similar to: > >> <img src="/images/pic.jpg" height="30" width="20" alt="sample image" /> > >> > >> Using the image control will produce code similar to > >> <asp:Image id="Image1" runat="server" alternatetext="sample image" > >> height="30px" imageurl="~/images/pic.jpg" width="20px" /> > >> > >> Where the ~/images refers to the images folder at the application root, > >> which is often (but not always) the website root. > >> -- > >> Ron Symonds - Microsoft MVP (FrontPage) > >> Reply only to group - emails will be deleted unread. > >> > >> http://www.rxs-enterprises.org/fp > >> > >> > >> > >> > >> "Peter K" <PeterK@discusions.microsoft.com> wrote in message > >> news:17D5E5D3-5045-4706-9EEA-731BFCB07ABF@microsoft.com: > >> > >>> I am developing a new web site, using ASP.Net pages. > >>> > >>> The root directory contains the master page (master.master), the home > >>> page > >>> (default.aspx), a folder for styles and a folder with a few images > >>> (images). > >>> All other pages are in sub-directories, beginning with a folder > >>> 'Continents' > >>> which, of course, also is located in the root directory. > >>> > >>> The master.master page contains an image, which is located in the folder > >>> 'images'. > >>> > >>> It shows fine in default.aspx. None of the other pages, located in > >>> 'Continents', or subfolders of 'Continents' show the image. Viewing any > >>> of > >>> those pages in a browser & clicking on the little white square with red > >>> X & > >>> selecting properties, it is obvious why: the page is looking for the > >>> image > >>> in folder '(root)/Continents/subfolders..../images', which in general > >>> might > >>> or might not exist. How can I force the subpages to look for the image > >>> in > >>> '(root)/images'? > >>> > >>> Puting all sub-pages (about 30 or so) into the root folder would lead to > >>> a > >>> very poor organization & putting a folder 'images' with that image into > >>> all > >>> subfolders is equally destructive. > >>> > >>> I am surprised that Expression Web does not automatically redirects the > >>> sub-pages to get the image from the image folder in the root directory. > >>> Unfortunately, one cannot do this via a code correction, since the code > >>> for > >>> the sub pages just refers to master.master & only adds the local > >>> content. > >>> > >>> Any help would be appreciated. > >> > >> > > > > |
|
|
|
#8 |
|
Guest
Posts: n/a
|
Re: Image from Master Page not shown on Pages in Subdirectories
I was referring to design view in Expression V1 and I use the development
server. I do not see the images in the EW design view but do when previewing in browser. Has that changed in V2? I haven't checked. -- Cheryl D Wise MS MVP Expression Author: Foundations of Microsoft Expression Web http://by-expression.com mail list: http://groups.google.com/group/by-ex...n-web-designer "Ronx" <ronx917@hotmail.com> wrote in message news:eQfENi1jIHA.4908@TK2MSFTNGP03.phx.gbl... > Root relative will show the images in design view if working on a server > based website (such as a development server). > > -- > Ron Symonds - Microsoft MVP (FrontPage) > Reply only to group - emails will be deleted unread. > > http://www.rxs-enterprises.org/fp > > > > > "Cheryl D Wise" <nomail@wiserways.com> wrote in message > news:et6IOY1jIHA.4244@TK2MSFTNGP06.phx.gbl: > >> Root relative /folder/file will always work regardless of folder since it >> is >> the path from the website root. What it will not do is show the image in >> design view. For ASP.NET image controls the ~ before the / means from the >> application root which is usually the same as the website root though it >> could be different. >> >> -- >> Cheryl D Wise >> MS MVP Expression >> Author: Foundations of Microsoft Expression Web >> http://by-expression.com >> mail list: http://groups.google.com/group/by-ex...n-web-designer >> >> >> "d. smith" <dsmith@performance-plus.ca> wrote in message >> news:%23HO6YY0jIHA.5820@TK2MSFTNGP04.phx.gbl... >> > Sorry but your realtive path idea doesn't work if you call child pages >> > from directories other than the root. >> > >> > I had the same problem. The problem occurs when calling webpages on >> > different levels of the website. >> > >> > The example " A root relative link (to an image) would be similar to: >> > <img src="/images/pic.jpg" height="30" width="20" alt="sample image" >> > />" >> > >> > doesn't work for a child page called from say >> > ../../topic_folder/webpage.aspx" for example and not just >> > ../webpagetop_folder/webpage.aspx >> > >> > In fact, the code above <img src="/images/pic.jpg" height="30" >> > width="20" >> > alt="sample image" />" shouldn't have the " /" before the folder >> > "images" >> > to work >> > >> > Using .net 2.0 and "Using the image control will produce code similar >> > to >> > <asp:Image id="Image1" runat="server" alternatetext="sample image" >> > height="30px" imageurl="~/images/pic.jpg" width="20px" /> >> > >> > The ~/ in the path tells the compiler to use the root directory and put >> > in >> > the proper full path in the compiled webpage so you don't have to. The >> > same goes for navigation menu items in html and asp .net. >> > >> > ds >> > >> > "Ronx" <ronx917@hotmail.com> wrote in message >> > news:OSFJBcDjIHA.4076@TK2MSFTNGP05.phx.gbl... >> >> Either use a asp.NET image control, instead of an HTML image, or use >> >> root >> >> relative links. >> >> >> >> A root relative link (to an image) would be similar to: >> >> <img src="/images/pic.jpg" height="30" width="20" alt="sample image" >> >> /> >> >> >> >> Using the image control will produce code similar to >> >> <asp:Image id="Image1" runat="server" alternatetext="sample image" >> >> height="30px" imageurl="~/images/pic.jpg" width="20px" /> >> >> >> >> Where the ~/images refers to the images folder at the application >> >> root, >> >> which is often (but not always) the website root. >> >> -- >> >> Ron Symonds - Microsoft MVP (FrontPage) >> >> Reply only to group - emails will be deleted unread. >> >> >> >> http://www.rxs-enterprises.org/fp >> >> >> >> >> >> >> >> >> >> "Peter K" <PeterK@discusions.microsoft.com> wrote in message >> >> news:17D5E5D3-5045-4706-9EEA-731BFCB07ABF@microsoft.com: >> >> >> >>> I am developing a new web site, using ASP.Net pages. >> >>> >> >>> The root directory contains the master page (master.master), the home >> >>> page >> >>> (default.aspx), a folder for styles and a folder with a few images >> >>> (images). >> >>> All other pages are in sub-directories, beginning with a folder >> >>> 'Continents' >> >>> which, of course, also is located in the root directory. >> >>> >> >>> The master.master page contains an image, which is located in the >> >>> folder >> >>> 'images'. >> >>> >> >>> It shows fine in default.aspx. None of the other pages, located in >> >>> 'Continents', or subfolders of 'Continents' show the image. Viewing >> >>> any >> >>> of >> >>> those pages in a browser & clicking on the little white square with >> >>> red >> >>> X & >> >>> selecting properties, it is obvious why: the page is looking for the >> >>> image >> >>> in folder '(root)/Continents/subfolders..../images', which in general >> >>> might >> >>> or might not exist. How can I force the subpages to look for the >> >>> image >> >>> in >> >>> '(root)/images'? >> >>> >> >>> Puting all sub-pages (about 30 or so) into the root folder would lead >> >>> to >> >>> a >> >>> very poor organization & putting a folder 'images' with that image >> >>> into >> >>> all >> >>> subfolders is equally destructive. >> >>> >> >>> I am surprised that Expression Web does not automatically redirects >> >>> the >> >>> sub-pages to get the image from the image folder in the root >> >>> directory. >> >>> Unfortunately, one cannot do this via a code correction, since the >> >>> code >> >>> for >> >>> the sub pages just refers to master.master & only adds the local >> >>> content. >> >>> >> >>> Any help would be appreciated. >> >> >> >> >> > >> > > |
|
|
|
#9 |
|
Guest
Posts: n/a
|
Re: Image from Master Page not shown on Pages in Subdirectories
No change in version 2.
I use a Windows 2003 server for development - sorry for the confusion in naming, but I tried not to imply using the live site's server. -- Ron Symonds - Microsoft MVP (FrontPage) Reply only to group - emails will be deleted unread. http://www.rxs-enterprises.org/fp "Cheryl D Wise" <nomail@wiserways.com> wrote in message news:OuC6eN2jIHA.5660@TK2MSFTNGP02.phx.gbl: > I was referring to design view in Expression V1 and I use the development > server. I do not see the images in the EW design view but do when previewing > in browser. Has that changed in V2? I haven't checked. > > -- > Cheryl D Wise > MS MVP Expression > Author: Foundations of Microsoft Expression Web > http://by-expression.com > mail list: http://groups.google.com/group/by-ex...n-web-designer > > > "Ronx" <ronx917@hotmail.com> wrote in message > news:eQfENi1jIHA.4908@TK2MSFTNGP03.phx.gbl... > > Root relative will show the images in design view if working on a server > > based website (such as a development server). > > > > -- > > Ron Symonds - Microsoft MVP (FrontPage) > > Reply only to group - emails will be deleted unread. > > > > http://www.rxs-enterprises.org/fp > > > > > > > > > > "Cheryl D Wise" <nomail@wiserways.com> wrote in message > > news:et6IOY1jIHA.4244@TK2MSFTNGP06.phx.gbl: > > > >> Root relative /folder/file will always work regardless of folder since it > >> is > >> the path from the website root. What it will not do is show the image in > >> design view. For ASP.NET image controls the ~ before the / means from the > >> application root which is usually the same as the website root though it > >> could be different. > >> > >> -- > >> Cheryl D Wise > >> MS MVP Expression > >> Author: Foundations of Microsoft Expression Web > >> http://by-expression.com > >> mail list: http://groups.google.com/group/by-ex...n-web-designer > >> > >> > >> "d. smith" <dsmith@performance-plus.ca> wrote in message > >> news:%23HO6YY0jIHA.5820@TK2MSFTNGP04.phx.gbl... > >> > Sorry but your realtive path idea doesn't work if you call child pages > >> > from directories other than the root. > >> > > >> > I had the same problem. The problem occurs when calling webpages on > >> > different levels of the website. > >> > > >> > The example " A root relative link (to an image) would be similar to: > >> > <img src="/images/pic.jpg" height="30" width="20" alt="sample image" > >> > />" > >> > > >> > doesn't work for a child page called from say > >> > ../../topic_folder/webpage.aspx" for example and not just > >> > ../webpagetop_folder/webpage.aspx > >> > > >> > In fact, the code above <img src="/images/pic.jpg" height="30" > >> > width="20" > >> > alt="sample image" />" shouldn't have the " /" before the folder > >> > "images" > >> > to work > >> > > >> > Using .net 2.0 and "Using the image control will produce code similar > >> > to > >> > <asp:Image id="Image1" runat="server" alternatetext="sample image" > >> > height="30px" imageurl="~/images/pic.jpg" width="20px" /> > >> > > >> > The ~/ in the path tells the compiler to use the root directory and put > >> > in > >> > the proper full path in the compiled webpage so you don't have to. The > >> > same goes for navigation menu items in html and asp .net. > >> > > >> > ds > >> > > >> > "Ronx" <ronx917@hotmail.com> wrote in message > >> > news:OSFJBcDjIHA.4076@TK2MSFTNGP05.phx.gbl... > >> >> Either use a asp.NET image control, instead of an HTML image, or use > >> >> root > >> >> relative links. > >> >> > >> >> A root relative link (to an image) would be similar to: > >> >> <img src="/images/pic.jpg" height="30" width="20" alt="sample image" > >> >> /> > >> >> > >> >> Using the image control will produce code similar to > >> >> <asp:Image id="Image1" runat="server" alternatetext="sample image" > >> >> height="30px" imageurl="~/images/pic.jpg" width="20px" /> > >> >> > >> >> Where the ~/images refers to the images folder at the application > >> >> root, > >> >> which is often (but not always) the website root. > >> >> -- > >> >> Ron Symonds - Microsoft MVP (FrontPage) > >> >> Reply only to group - emails will be deleted unread. > >> >> > >> >> http://www.rxs-enterprises.org/fp > >> >> > >> >> > >> >> > >> >> > >> >> "Peter K" <PeterK@discusions.microsoft.com> wrote in message > >> >> news:17D5E5D3-5045-4706-9EEA-731BFCB07ABF@microsoft.com: > >> >> > >> >>> I am developing a new web site, using ASP.Net pages. > >> >>> > >> >>> The root directory contains the master page (master.master), the home > >> >>> page > >> >>> (default.aspx), a folder for styles and a folder with a few images > >> >>> (images). > >> >>> All other pages are in sub-directories, beginning with a folder > >> >>> 'Continents' > >> >>> which, of course, also is located in the root directory. > >> >>> > >> >>> The master.master page contains an image, which is located in the > >> >>> folder > >> >>> 'images'. > >> >>> > >> >>> It shows fine in default.aspx. None of the other pages, located in > >> >>> 'Continents', or subfolders of 'Continents' show the image. Viewing > >> >>> any > >> >>> of > >> >>> those pages in a browser & clicking on the little white square with > >> >>> red > >> >>> X & > >> >>> selecting properties, it is obvious why: the page is looking for the > >> >>> image > >> >>> in folder '(root)/Continents/subfolders..../images', which in general > >> >>> might > >> >>> or might not exist. How can I force the subpages to look for the > >> >>> image > >> >>> in > >> >>> '(root)/images'? > >> >>> > >> >>> Puting all sub-pages (about 30 or so) into the root folder would lead > >> >>> to > >> >>> a > >> >>> very poor organization & putting a folder 'images' with that image > >> >>> into > >> >>> all > >> >>> subfolders is equally destructive. > >> >>> > >> >>> I am surprised that Expression Web does not automatically redirects > >> >>> the > >> >>> sub-pages to get the image from the image folder in the root > >> >>> directory. > >> >>> Unfortunately, one cannot do this via a code correction, since the > >> >>> code > >> >>> for > >> >>> the sub pages just refers to master.master & only adds the local > >> >>> content. > >> >>> > >> >>> Any help would be appreciated. > >> >> > >> >> > >> > > >> > > > |
|
|
|
#10 |
|
Guest
Posts: n/a
|
Re: Image from Master Page not shown on Pages in Subdirectories
No problem, I sort of suspected you were using IIS but figured I'd try to
make it clearer. <g> -- Cheryl D Wise MS MVP Expression Author: Foundations of Microsoft Expression Web http://by-expression.com mail list: http://groups.google.com/group/by-ex...n-web-designer "Ronx" <ronx917@hotmail.com> wrote in message news:%23mvGdB3jIHA.1168@TK2MSFTNGP02.phx.gbl... > No change in version 2. > > I use a Windows 2003 server for development - sorry for the confusion in > naming, but I tried not to imply using the live site's server. > -- > Ron Symonds - Microsoft MVP (FrontPage) > Reply only to group - emails will be deleted unread. > > http://www.rxs-enterprises.org/fp > > > > > "Cheryl D Wise" <nomail@wiserways.com> wrote in message > news:OuC6eN2jIHA.5660@TK2MSFTNGP02.phx.gbl: > >> I was referring to design view in Expression V1 and I use the development >> server. I do not see the images in the EW design view but do when >> previewing >> in browser. Has that changed in V2? I haven't checked. >> >> -- >> Cheryl D Wise >> MS MVP Expression >> Author: Foundations of Microsoft Expression Web >> http://by-expression.com >> mail list: http://groups.google.com/group/by-ex...n-web-designer >> >> >> "Ronx" <ronx917@hotmail.com> wrote in message >> news:eQfENi1jIHA.4908@TK2MSFTNGP03.phx.gbl... >> > Root relative will show the images in design view if working on a >> > server >> > based website (such as a development server). >> > >> > -- >> > Ron Symonds - Microsoft MVP (FrontPage) >> > Reply only to group - emails will be deleted unread. >> > >> > http://www.rxs-enterprises.org/fp >> > >> > >> > >> > >> > "Cheryl D Wise" <nomail@wiserways.com> wrote in message >> > news:et6IOY1jIHA.4244@TK2MSFTNGP06.phx.gbl: >> > >> >> Root relative /folder/file will always work regardless of folder since >> >> it >> >> is >> >> the path from the website root. What it will not do is show the image >> >> in >> >> design view. For ASP.NET image controls the ~ before the / means from >> >> the >> >> application root which is usually the same as the website root though >> >> it >> >> could be different. >> >> >> >> -- >> >> Cheryl D Wise >> >> MS MVP Expression >> >> Author: Foundations of Microsoft Expression Web >> >> http://by-expression.com >> >> mail list: http://groups.google.com/group/by-ex...n-web-designer >> >> >> >> >> >> "d. smith" <dsmith@performance-plus.ca> wrote in message >> >> news:%23HO6YY0jIHA.5820@TK2MSFTNGP04.phx.gbl... >> >> > Sorry but your realtive path idea doesn't work if you call child >> >> > pages >> >> > from directories other than the root. >> >> > >> >> > I had the same problem. The problem occurs when calling webpages on >> >> > different levels of the website. >> >> > >> >> > The example " A root relative link (to an image) would be similar >> >> > to: >> >> > <img src="/images/pic.jpg" height="30" width="20" alt="sample image" >> >> > />" >> >> > >> >> > doesn't work for a child page called from say >> >> > ../../topic_folder/webpage.aspx" for example and not just >> >> > ../webpagetop_folder/webpage.aspx >> >> > >> >> > In fact, the code above <img src="/images/pic.jpg" height="30" >> >> > width="20" >> >> > alt="sample image" />" shouldn't have the " /" before the folder >> >> > "images" >> >> > to work >> >> > >> >> > Using .net 2.0 and "Using the image control will produce code >> >> > similar >> >> > to >> >> > <asp:Image id="Image1" runat="server" alternatetext="sample image" >> >> > height="30px" imageurl="~/images/pic.jpg" width="20px" /> >> >> > >> >> > The ~/ in the path tells the compiler to use the root directory and >> >> > put >> >> > in >> >> > the proper full path in the compiled webpage so you don't have to. >> >> > The >> >> > same goes for navigation menu items in html and asp .net. >> >> > >> >> > ds >> >> > >> >> > "Ronx" <ronx917@hotmail.com> wrote in message >> >> > news:OSFJBcDjIHA.4076@TK2MSFTNGP05.phx.gbl... >> >> >> Either use a asp.NET image control, instead of an HTML image, or >> >> >> use >> >> >> root >> >> >> relative links. >> >> >> >> >> >> A root relative link (to an image) would be similar to: >> >> >> <img src="/images/pic.jpg" height="30" width="20" alt="sample >> >> >> image" >> >> >> /> >> >> >> >> >> >> Using the image control will produce code similar to >> >> >> <asp:Image id="Image1" runat="server" alternatetext="sample image" >> >> >> height="30px" imageurl="~/images/pic.jpg" width="20px" /> >> >> >> >> >> >> Where the ~/images refers to the images folder at the application >> >> >> root, >> >> >> which is often (but not always) the website root. >> >> >> -- >> >> >> Ron Symonds - Microsoft MVP (FrontPage) >> >> >> Reply only to group - emails will be deleted unread. >> >> >> >> >> >> http://www.rxs-enterprises.org/fp >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> "Peter K" <PeterK@discusions.microsoft.com> wrote in message >> >> >> news:17D5E5D3-5045-4706-9EEA-731BFCB07ABF@microsoft.com: >> >> >> >> >> >>> I am developing a new web site, using ASP.Net pages. >> >> >>> >> >> >>> The root directory contains the master page (master.master), the >> >> >>> home >> >> >>> page >> >> >>> (default.aspx), a folder for styles and a folder with a few images >> >> >>> (images). >> >> >>> All other pages are in sub-directories, beginning with a folder >> >> >>> 'Continents' >> >> >>> which, of course, also is located in the root directory. >> >> >>> >> >> >>> The master.master page contains an image, which is located in the >> >> >>> folder >> >> >>> 'images'. >> >> >>> >> >> >>> It shows fine in default.aspx. None of the other pages, located >> >> >>> in >> >> >>> 'Continents', or subfolders of 'Continents' show the image. >> >> >>> Viewing >> >> >>> any >> >> >>> of >> >> >>> those pages in a browser & clicking on the little white square >> >> >>> with >> >> >>> red >> >> >>> X & >> >> >>> selecting properties, it is obvious why: the page is looking for >> >> >>> the >> >> >>> image >> >> >>> in folder '(root)/Continents/subfolders..../images', which in >> >> >>> general >> >> >>> might >> >> >>> or might not exist. How can I force the subpages to look for the >> >> >>> image >> >> >>> in >> >> >>> '(root)/images'? >> >> >>> >> >> >>> Puting all sub-pages (about 30 or so) into the root folder would >> >> >>> lead >> >> >>> to >> >> >>> a >> >> >>> very poor organization & putting a folder 'images' with that image >> >> >>> into >> >> >>> all >> >> >>> subfolders is equally destructive. >> >> >>> >> >> >>> I am surprised that Expression Web does not automatically >> >> >>> redirects >> >> >>> the >> >> >>> sub-pages to get the image from the image folder in the root >> >> >>> directory. >> >> >>> Unfortunately, one cannot do this via a code correction, since the >> >> >>> code >> >> >>> for >> >> >>> the sub pages just refers to master.master & only adds the local >> >> >>> content. >> >> >>> >> >> >>> Any help would be appreciated. >> >> >> >> >> >> >> >> > >> >> > >> > > |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|