1

Hello,

I developed a website in which I added a master page,header and footer.
In the header, I added a code but its not working fine because the pages that I am adding are in another folders as shown below...

<li><a href="Home.aspx">Home</a></li>
<li><a href="KMApps/KMAppsHome.aspx">Applications</a></li>

As you can see that KMAppsHome.aspx is contained in a folder named KMApps but as I run this application the images of Header.ascx are not shown in KMAppsHome and when I click back on Home.aspx it displays Error 404 Page Not Found.

I've also used relative paths like ../KMApps/KMAppsHome.aspx instead of KMApps/KMAppsHome.aspx but the problem is still same.

Please help me.

Thanks in advance.

Edited by KM499: n/a

5
Contributors
14
Replies
17
Views
6 Years
Discussion Span
Last Post by KM499
Featured Replies
  • 1

    Please reply anyone...I think its a path problem only... Thanks in advance. Read More

  • 1

    Thanks adatapost but what about the images? I mean I used <img> and its working fine that is the images are being shown with src="~/Images/..." but in the master page I used <div> for ContentPlaceHolder,Header,Footer and Sidebar and there I used [CODE] <div style="background-image:url(~/Images/...)" runat="server"> <asp:ContentPlaceHolder ID="KMContents" runat="server"> </asp:ContentPlaceHolder> </div> … Read More

  • 1

    Could you please tell me that how can I, in this case, apply a background image in ContentPlaceHolder that will be displayed in all the pages ? Read More

  • 1

    Hi adatapost could you please provide me the solution quickly or anyone else ? Thanks in advance. Read More

  • 1

    Please help me someone its damn urgent. Thank you very much in advance. Read More

1

Please reply anyone...I think its a path problem only...

Thanks in advance.

0

Use ASP.NET server control (HyperLink)

<li><a runat="server" href="~/Home.aspx">Home</a></li>
<li><a runat="server" href="~/KMApps/KMAppsHome.aspx">Applications</a></li>
1

Thanks adatapost but what about the images?
I mean I used <img> and its working fine that is the images are being shown with src="~/Images/..." but in the master page I used <div> for ContentPlaceHolder,Header,Footer and Sidebar and there I used

<div style="background-image:url(~/Images/...)" runat="server">
<asp:ContentPlaceHolder ID="KMContents" runat="server">
</asp:ContentPlaceHolder>
</div>

but in this the same problem is occuring that is the images disappear when I click on KMAppsHome.aspx Link which is located in the folder KMApps/KMAppsHome.aspx

Thanks in advace.

Edited by KM499: n/a

0

~ - is root operator only used for asp.net and html server controls. You can not use root operator for style-sheet attributes. You need to organize your folder/files (resources) according their usage.

1

Could you please tell me that how can I, in this case, apply a background image in ContentPlaceHolder that will be displayed in all the pages ?

Edited by KM499: n/a

1

Hi adatapost could you please provide me the solution quickly or anyone else ?

Thanks in advance.

Edited by KM499: n/a

1

Please help me someone its damn urgent.

Thank you very much in advance.

0

use ../path (absolute path) in the Style Sheets for images and other media files.
use ~/path (relative path) in the server web pages links for navigation.

its always better to re-organize the entire project structure and test it locally before proceeding further, if it will not take much time.

0

Just drag the Image Path From the Solution Explore .Check whether images are loading or not.. if it is loding the images then change path to ../Images

1

Thanks nebyas and prateekpk5 for your replies but I'm still facing problems with ~/ and ../
Anyways, I am reorganizing my web contents once again and see if that works.

Thanks.

1

Sorry to all the experts but this is not working.
Anyways I'll try to organize me contents once again properly.
Thanks to all for their kind help.

0

The error may be due to the reason that may be the requested page is set to offline. Just check that in the menu. Hope it will work

Thanks

1

Thanks a lot for your kind replies however I suppose that it was a content-organizing problem but anyways I've rearranged my contents accordingly...Let me see what I can do for it now.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.