locked
Using Content pages from a different directory RRS feed

  • Question

  • User201647903 posted

    Hi All :-)

    I'm new to ASP.Net 2.0.  We just installed it and are working through the kinks in the conversion.  I've created a Master page - that went smoothly, but, when I try to create a new (or use an existing) content page that resides in a sub-directory, none of the images work.  We have our original project set up with many separate sub-directories such as:

    Default (for the login and password change pages), Common (for pages that are commonly used), Financial (for all the pages related to Invoices and payments), and a couple of others.

    When I create the content page in one of these sub-directories, none of the images from the master page are working correctly. I get the X in the box - can anyone suggest how to fix this problem?  We don't want all our pages in one directory, there are too many of them!

    TIA,

    Coleen  

     

    Monday, September 25, 2006 4:10 PM

Answers

  • User390817712 posted

    Coleen:

     If you use server-side image controls, ASP.NET will "rebase" the URLs to the images automatically. For example, an <asp:Image> control or a <img runat="server"> tag will fixup the relative URLs to your images.

    I have some specific examples in the "Break Some URLs" section of "Master Pages: Tips, Tricks, and Traps".

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 26, 2006 10:30 AM
  • User201647903 posted

    Thank you to all who responded - I appreciate it!

    I was out yesterday and just got back and found these wonderful responses.  I have tried and found that (so far) by setting the image to the relative path:

    Old
    <a href="http://www.nv.gov/"><img height="89" alt="State of Nevada" src="../images/state_blue.jpg" width="89" align="top"
          border="0"> </a>

    New
    <a href="http://www.nv.gov/"><img src="images/state_blue.jpg" runat=server alt="State of Nevada" /> </a>

    This seems to work.  I am still trying to make sure that all my pages convert to content pages and show the images from the master page correctly, but, it seems to work correctly like this. 

    Thanks so much for the links and info; this site has been invaluable to me in this conversion process.

    Coleen

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 27, 2006 2:11 PM

All replies

  • User1367128627 posted

    See my previous posts:
    http://forums.asp.net/thread/1377014.aspx
    http://forums.asp.net/thread/1397083.aspx

    Regards.

    Monday, September 25, 2006 10:33 PM
  • User312496708 posted

    See this post of mine on master page. I have discussed the solution to ur question

     http://www.vikramlakhotia.com/Working_With_Master_Page.aspx

    Hope this helps

    Thanks

    Vikram

     Vikram's Blog

    Tuesday, September 26, 2006 7:02 AM
  • User390817712 posted

    Coleen:

     If you use server-side image controls, ASP.NET will "rebase" the URLs to the images automatically. For example, an <asp:Image> control or a <img runat="server"> tag will fixup the relative URLs to your images.

    I have some specific examples in the "Break Some URLs" section of "Master Pages: Tips, Tricks, and Traps".

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 26, 2006 10:30 AM
  • User201647903 posted

    Thank you to all who responded - I appreciate it!

    I was out yesterday and just got back and found these wonderful responses.  I have tried and found that (so far) by setting the image to the relative path:

    Old
    <a href="http://www.nv.gov/"><img height="89" alt="State of Nevada" src="../images/state_blue.jpg" width="89" align="top"
          border="0"> </a>

    New
    <a href="http://www.nv.gov/"><img src="images/state_blue.jpg" runat=server alt="State of Nevada" /> </a>

    This seems to work.  I am still trying to make sure that all my pages convert to content pages and show the images from the master page correctly, but, it seems to work correctly like this. 

    Thanks so much for the links and info; this site has been invaluable to me in this conversion process.

    Coleen

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 27, 2006 2:11 PM