1

I have a master page design with the following structure:

main.master
index.aspx
    folder A
      indexa.aspx
    folder B
      indexb.aspx
    folder C
      indexc.aspx

when i run the app, the index.aspx is the default page . From that page i want to navigate between all the pages. Ex. navigate from the index.aspx to indexa.aspx and from indexa.aspx to indexc.aspx, and so on. but actually i am getting resource not found

   <div class="navbar-right">
    <ul class="nav navbar-nav">
        <li>
            <a href="~/../folder A/indexa.aspx">
            </a>
        </li>
        <li>
            <a href="~/../folder C/indexb.aspx">
            </a>
        </li>
        <li>
            <a href="~/../folder C/indexc.aspx" >
            </a>
        </li>
       </ul>
  </div>

 <ul class="sidebar-menu">
        <li class="active">
            <a href="../index.aspx">
            </a>
        </li>
</ul>
Siguza
  • 21,155
  • 6
  • 52
  • 89
Jmocke
  • 269
  • 1
  • 10
  • 20
  • why are you saying "one folder behind the project root/folder A/"? – Kritner Jul 28 '14 at 17:59
  • in the root directory , i created 3 folders to group my work, folder A,B, and C. Each folder has its content pages from the main master page named main. @Kritner – Jmocke Jul 28 '14 at 18:01
  • remove ../ and just use ~/folderA/indexa.aspx – ffffff01 Jul 28 '14 at 18:02
  • "~" implies root unless I am mistaken. If you goto root, then back a directory, then into folder A, that does not match that information you typed out if your structure – Kritner Jul 28 '14 at 18:03
  • @Kritner one folder behind the project root , it is to get back to the main index.aspx page – Jmocke Jul 28 '14 at 18:03

1 Answers1

1

From your structure:

C:/projects/
    main.master
    index.aspx
    folder A/
      indexa.aspx
    folder B/
      indexb.aspx
    folder C/
      indexc.aspx

The URL "~/../folder A/indexa.aspx" would take you to "C:/folder A/indexa.aspx"

You want "~/folder A/indexa.aspx"

to take you to "C:/projects/folder a/indexa.aspx"

From my understanding however, you need to use a server control for "~" to work properly. use of tilde (~) in asp.net path

Community
  • 1
  • 1
Kritner
  • 13,557
  • 10
  • 46
  • 72