Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
1)i have a master page where two button one is signin and another one is contact.
2) signin.aspx page in save in signin folder and contact.aspx is in open (not any folder)
3) when i click for signin.aspx its work (http://localhost:60765/signin/signin.aspx) but when i click for contact (http://localhost:60765/signin/contact.aspx) it's also search in signin folder

and show error "resource not fond"

What I have tried:

ASP.NET
<pre> <a runat="server"  href="/signin/signin.aspx" >Sign in</a>

other for contact

<a runat="server"  href="contact.aspx" >contact</a>
Posted
Updated 2-Jan-17 14:11pm

1 solution

You are using a relative path to the page. You should be using a full path.
When referencing pages/images/scripts within a ASPX page you should include the full path from the root directory.
Lets say you have the following structure;
Default.aspx in root directory
SiteMaster.Master in folder named Master
Signin.aspx in folder named Singin
Contact.aspx in folder named Contact
About.aspx in root folder

The full path to each of these files would be;
~/Default.aspx
~/Master/Sitemaster.Master
~/Singin/Singin.aspx
~/Contact/Contact.aspx
~/About.aspx
The "~" character indicates the root of you website

You really shouldn't use relative paths
Refer: ASP.NET Web Project Paths[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900