Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Problem in accessing page from folder [modified]

Problem in accessing page from folder [modified]

Scheduled Pinned Locked Moved ASP.NET
asp-netsysadmindata-structureshelpquestion
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ais07
    wrote on last edited by
    #1

    Hi There I have menu tree.I had given path of my web forms in menu tree using naviage url propery.My web forms are present in admin folder. My problem is that when I run the project using following code then my page doesn't get open. Menu Tree Code But when I keep my web forms in root directory and Change the path to NavigateUrl="~//Company.aspx" then it works.Why this is happening Even I tried ~//Admin/CreateUser.aspx but it is also not working. Can anybody tell me what is the reason. (I am running my project web server on net)

    Life Is Beautiful

    modified on Tuesday, August 11, 2009 2:51 AM

    Z 1 Reply Last reply
    0
    • A ais07

      Hi There I have menu tree.I had given path of my web forms in menu tree using naviage url propery.My web forms are present in admin folder. My problem is that when I run the project using following code then my page doesn't get open. Menu Tree Code But when I keep my web forms in root directory and Change the path to NavigateUrl="~//Company.aspx" then it works.Why this is happening Even I tried ~//Admin/CreateUser.aspx but it is also not working. Can anybody tell me what is the reason. (I am running my project web server on net)

      Life Is Beautiful

      modified on Tuesday, August 11, 2009 2:51 AM

      Z Offline
      Z Offline
      Zafar A khan
      wrote on last edited by
      #2

      try navigateurl like this Replace (~) with (..)

      asp:Menu id="Menu1" runat="server" SkinID="Menu">

      <asp:MenuItem Text="Admin" Value="Admin">
      <asp:MenuItem NavigateUrl="../Admin/Company.aspx" Text="Company Master"
      Value="Company Master">
      <asp:MenuItem NavigateUrl="../Admin/BranchMaster.aspx" Text="Branch Master"
      Value="Branch Master">
      <asp:MenuItem NavigateUrl="../Admin/CreateUser.aspx" Text="Create User"
      Value="Create User">
      <asp:MenuItem NavigateUrl="../Admin/RoleMaster.aspx" Text="Role Master"
      Value="Role Master">

      A 2 Replies Last reply
      0
      • Z Zafar A khan

        try navigateurl like this Replace (~) with (..)

        asp:Menu id="Menu1" runat="server" SkinID="Menu">

        <asp:MenuItem Text="Admin" Value="Admin">
        <asp:MenuItem NavigateUrl="../Admin/Company.aspx" Text="Company Master"
        Value="Company Master">
        <asp:MenuItem NavigateUrl="../Admin/BranchMaster.aspx" Text="Branch Master"
        Value="Branch Master">
        <asp:MenuItem NavigateUrl="../Admin/CreateUser.aspx" Text="Create User"
        Value="Create User">
        <asp:MenuItem NavigateUrl="../Admin/RoleMaster.aspx" Text="Role Master"
        Value="Role Master">

        A Offline
        A Offline
        ais07
        wrote on last edited by
        #3

        Thanks for reply Zafar, I will try your code. But when googled on this problem every body suggested not use ../ Instead of they suggested to use ~/

        Life Is Beautiful

        1 Reply Last reply
        0
        • Z Zafar A khan

          try navigateurl like this Replace (~) with (..)

          asp:Menu id="Menu1" runat="server" SkinID="Menu">

          <asp:MenuItem Text="Admin" Value="Admin">
          <asp:MenuItem NavigateUrl="../Admin/Company.aspx" Text="Company Master"
          Value="Company Master">
          <asp:MenuItem NavigateUrl="../Admin/BranchMaster.aspx" Text="Branch Master"
          Value="Branch Master">
          <asp:MenuItem NavigateUrl="../Admin/CreateUser.aspx" Text="Create User"
          Value="Create User">
          <asp:MenuItem NavigateUrl="../Admin/RoleMaster.aspx" Text="Role Master"
          Value="Role Master">

          A Offline
          A Offline
          ais07
          wrote on last edited by
          #4

          I tried that code but it is not working.

          Life Is Beautiful

          P 1 Reply Last reply
          0
          • A ais07

            I tried that code but it is not working.

            Life Is Beautiful

            P Offline
            P Offline
            padmanabhan N
            wrote on last edited by
            #5

            ~//Admin**/CreateUser.aspx "/" is considered as a escape sequence... so use ~//Admin//**CreateUser.aspx ... hope this will work

            Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

            G 1 Reply Last reply
            0
            • P padmanabhan N

              ~//Admin**/CreateUser.aspx "/" is considered as a escape sequence... so use ~//Admin//**CreateUser.aspx ... hope this will work

              Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

              G Offline
              G Offline
              Greg Chelstowski
              wrote on last edited by
              #6

              Of course it won't. Since when is "/" the escape sequence of anything? In C# the escape sequence is "\". The problem lies with the layout though. You have to embed menuitems in an Items tag, like this:

              <asp:Menu runat="server">
              <Items>
              <asp:MenuItem NavigateUrl="~/Default.aspx" Text="New Item" Value="New Item">
              </asp:MenuItem>
              <asp:MenuItem NavigateUrl="~/Default2.aspx" Text="New Item"
              Value="New Item"></asp:MenuItem>
              </Items>
              </asp:Menu>

              Also, would really be advisable if you actually CLOSED your menuitem tags. The path is correct as it is.

              var question = (_2b || !(_2b));

              P 1 Reply Last reply
              0
              • G Greg Chelstowski

                Of course it won't. Since when is "/" the escape sequence of anything? In C# the escape sequence is "\". The problem lies with the layout though. You have to embed menuitems in an Items tag, like this:

                <asp:Menu runat="server">
                <Items>
                <asp:MenuItem NavigateUrl="~/Default.aspx" Text="New Item" Value="New Item">
                </asp:MenuItem>
                <asp:MenuItem NavigateUrl="~/Default2.aspx" Text="New Item"
                Value="New Item"></asp:MenuItem>
                </Items>
                </asp:Menu>

                Also, would really be advisable if you actually CLOSED your menuitem tags. The path is correct as it is.

                var question = (_2b || !(_2b));

                P Offline
                P Offline
                padmanabhan N
                wrote on last edited by
                #7

                ais07 says: But when I keep my web forms in root directory and Change the path to NavigateUrl="~//Company.aspx" then it works.Why this is happening Even I tried ~//Admin/CreateUser.aspx but it is also not working. there is no error message metioned....

                Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups