Getting "The resource cannot be found" using href=

Discussion in 'ASP .Net' started by Tony Girgenti, Aug 5, 2007.

  1. Hello.

    I have an ASP.NET 2.0 web site with a master page that works fine when i
    test it in VS2005, but when i upload it to a live isp site, it gives the
    error at the end of this post for one of the links. Here is the line that
    has the link:
    <div class="readmore"><a href="/CoyneWebServices/File
    Maintenance/Warehouses.aspx" title="More info">&raquo; more</a></div>

    I tried putting a tilde"~" after the href=", but it won't allow that line in
    the source view.

    I also tried using:
    <div class="readmore"><a href="CoyneWebServices/File
    Maintenance/Warehouses.aspx" title="More info">&raquo; more</a></div>

    <div class="readmore"><a
    href="http://www.tonygirgenti.info/CoyneWebServices/File
    Maintenance/Warehouses.aspx" title="More info">&raquo; more</a></div>

    <div class="readmore"><a href="/File Maintenance/Warehouses.aspx"
    title="More info">&raquo; more</a></div>

    Any help would be gratefully appreciated.

    Thanks,
    Tony



    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    The resource cannot be found.
    Description: HTTP 404. The resource you are looking for (or one of its
    dependencies) could have been removed, had its name changed, or is
    temporarily unavailable. Please review the following URL and make sure that
    it is spelled correctly.

    Requested URL: /CoyneWebServices/File Maintenance/Warehouses.aspx




    --------------------------------------------------------------------------------

    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
    Version:2.0.50727.210
     
    Tony Girgenti, Aug 5, 2007
    #1
    1. Advertising

  2. /CoyneWebServices/File Maintenance/Warehouses.aspx

    your link starts with a "/" this means "CoyneWebServices" is a folder in the
    root directory, but this may not be the case on your isp.

    You may need to use the "../../" addressing

    if you have say
    /folder1/folder2

    and
    /folder3/folder4

    and you had a file in folder4 that linked to a file in folder2 you would use

    .../../folder1/folder2

    and you had a file in folder3 that linked to a file in folder2 you would use

    .../folder1/folder2

    "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
    news:ORjt1%...
    > Hello.
    >
    > I have an ASP.NET 2.0 web site with a master page that works fine when i
    > test it in VS2005, but when i upload it to a live isp site, it gives the
    > error at the end of this post for one of the links. Here is the line that
    > has the link:
    > <div class="readmore"><a href="/CoyneWebServices/File
    > Maintenance/Warehouses.aspx" title="More info">&raquo; more</a></div>
    >
    > I tried putting a tilde"~" after the href=", but it won't allow that line
    > in the source view.
    >
    > I also tried using:
    > <div class="readmore"><a href="CoyneWebServices/File
    > Maintenance/Warehouses.aspx" title="More info">&raquo; more</a></div>
    >
    > <div class="readmore"><a
    > href="http://www.tonygirgenti.info/CoyneWebServices/File
    > Maintenance/Warehouses.aspx" title="More info">&raquo; more</a></div>
    >
    > <div class="readmore"><a href="/File Maintenance/Warehouses.aspx"
    > title="More info">&raquo; more</a></div>
    >
    > Any help would be gratefully appreciated.
    >
    > Thanks,
    > Tony
    >
    >
    >
    > Server Error in '/' Application.
    > --------------------------------------------------------------------------------
    >
    > The resource cannot be found.
    > Description: HTTP 404. The resource you are looking for (or one of its
    > dependencies) could have been removed, had its name changed, or is
    > temporarily unavailable. Please review the following URL and make sure
    > that it is spelled correctly.
    >
    > Requested URL: /CoyneWebServices/File Maintenance/Warehouses.aspx
    >
    >
    >
    >
    > --------------------------------------------------------------------------------
    >
    > Version Information: Microsoft .NET Framework Version:2.0.50727.42;
    > ASP.NET Version:2.0.50727.210
    >
    >
     
    ThatsIT.net.au, Aug 5, 2007
    #2
    1. Advertising

  3. "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
    news:ORjt1%...

    > I have an ASP.NET 2.0 web site with a master page that works fine when i
    > test it in VS2005, but when i upload it to a live isp site, it gives the
    > error at the end of this post for one of the links. Here is the line that
    > has the link:
    > <div class="readmore"><a href="/CoyneWebServices/File
    > Maintenance/Warehouses.aspx" title="More info">&raquo; more</a></div>


    1) Are you sure it actually exists on the live server...?

    2) You have spaces in your URL - avoid that if you possibly can

    3) You appear to have omitted the question mark at the beginning of the
    QueryString...


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
     
    Mark Rae [MVP], Aug 5, 2007
    #3
  4. Tony Girgenti wrote:
    > Hello.
    >
    > I have an ASP.NET 2.0 web site with a master page that works fine when i
    > test it in VS2005, but when i upload it to a live isp site, it gives the
    > error at the end of this post for one of the links. Here is the line that
    > has the link:
    > <div class="readmore"><a href="/CoyneWebServices/File
    > Maintenance/Warehouses.aspx" title="More info">&raquo; more</a></div>
    >
    > I tried putting a tilde"~" after the href=", but it won't allow that line in
    > the source view.


    You need to put runat="server" in the tag to be able to use the tilde.
    The server translates the tilde url to an actual url, so the control has
    to be a server control.

    <a href="~/CoyneWebServices/File%20Maintenance/Warehouses.aspx"
    title="More info" runat="server">&raquo; more</a>

    As mark mentioned, an URL should not contain spaces. Although most
    browsers doesn't care, a correct URL may not contain spaces.

    --
    Göran Andersson
    _____
    http://www.guffa.com
     
    =?ISO-8859-1?Q?G=F6ran_Andersson?=, Aug 5, 2007
    #4
  5. Hello ThatsIT.

    Using your logic, if i have off of the root
    "FileMaintenance/Warehouses.aspx"(i removed the space), from the
    AppMaster.master(which is in the root), i use
    <a href="/FileMaintenance/Warehouses.aspx" title="More info">&raquo;
    more</a>

    This works OK when uploaded to live site, but does not work when i run it
    from VS2005.

    Why is that?

    Thanks,
    Tony

    "ThatsIT.net.au" <me@thatsit> wrote in message
    news:...
    > /CoyneWebServices/File Maintenance/Warehouses.aspx
    >
    > your link starts with a "/" this means "CoyneWebServices" is a folder in
    > the root directory, but this may not be the case on your isp.
    >
    > You may need to use the "../../" addressing
    >
    > if you have say
    > /folder1/folder2
    >
    > and
    > /folder3/folder4
    >
    > and you had a file in folder4 that linked to a file in folder2 you would
    > use
    >
    > ../../folder1/folder2
    >
    > and you had a file in folder3 that linked to a file in folder2 you would
    > use
    >
    > ../folder1/folder2
    >
    > "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
    > news:ORjt1%...
    >> Hello.
    >>
    >> I have an ASP.NET 2.0 web site with a master page that works fine when i
    >> test it in VS2005, but when i upload it to a live isp site, it gives the
    >> error at the end of this post for one of the links. Here is the line
    >> that has the link:
    >> <div class="readmore"><a href="/CoyneWebServices/File
    >> Maintenance/Warehouses.aspx" title="More info">&raquo; more</a></div>
    >>
    >> I tried putting a tilde"~" after the href=", but it won't allow that line
    >> in the source view.
    >>
    >> I also tried using:
    >> <div class="readmore"><a href="CoyneWebServices/File
    >> Maintenance/Warehouses.aspx" title="More info">&raquo; more</a></div>
    >>
    >> <div class="readmore"><a
    >> href="http://www.tonygirgenti.info/CoyneWebServices/File
    >> Maintenance/Warehouses.aspx" title="More info">&raquo; more</a></div>
    >>
    >> <div class="readmore"><a href="/File Maintenance/Warehouses.aspx"
    >> title="More info">&raquo; more</a></div>
    >>
    >> Any help would be gratefully appreciated.
    >>
    >> Thanks,
    >> Tony
    >>
    >>
    >>
    >> Server Error in '/' Application.
    >> --------------------------------------------------------------------------------
    >>
    >> The resource cannot be found.
    >> Description: HTTP 404. The resource you are looking for (or one of its
    >> dependencies) could have been removed, had its name changed, or is
    >> temporarily unavailable. Please review the following URL and make sure
    >> that it is spelled correctly.
    >>
    >> Requested URL: /CoyneWebServices/File Maintenance/Warehouses.aspx
    >>
    >>
    >>
    >>
    >> --------------------------------------------------------------------------------
    >>
    >> Version Information: Microsoft .NET Framework Version:2.0.50727.42;
    >> ASP.NET Version:2.0.50727.210
    >>
    >>

    >
    >
     
    Tony Girgenti, Aug 6, 2007
    #5
  6. Hello Mark.

    >> 1) Are you sure it actually exists on the live server...?<<

    Not sure of what you mean by this. I can see it on the web site using ftp.
    I uploaded the whole site using ftp. Its there.

    > 2) You have spaces in your URL - avoid that if you possibly can

    Removed spaces.

    > 3) You appear to have omitted the question mark at the beginning of the
    > QueryString...

    What query string?

    Thanks,
    Tony

    "Mark Rae [MVP]" <> wrote in message
    news:%...
    > "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
    > news:ORjt1%...
    >
    >> I have an ASP.NET 2.0 web site with a master page that works fine when i
    >> test it in VS2005, but when i upload it to a live isp site, it gives the
    >> error at the end of this post for one of the links. Here is the line
    >> that has the link:
    >> <div class="readmore"><a href="/CoyneWebServices/File
    >> Maintenance/Warehouses.aspx" title="More info">&raquo; more</a></div>

    >
    > 1) Are you sure it actually exists on the live server...?
    >
    > 2) You have spaces in your URL - avoid that if you possibly can
    >
    > 3) You appear to have omitted the question mark at the beginning of the
    > QueryString...
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
     
    Tony Girgenti, Aug 6, 2007
    #6
  7. "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
    news:...

    >> 1) Are you sure it actually exists on the live server...?<<

    > Not sure of what you mean by this. I can see it on the web site using
    > ftp. I uploaded the whole site using ftp. Its there.


    And is it where it should be in the folder hierarchy...?

    >> 3) You appear to have omitted the question mark at the beginning of the
    >> QueryString...

    > What query string?


    Apologies - I didn't read your OP closely enough...


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
     
    Mark Rae [MVP], Aug 6, 2007
    #7
  8. Hello Goran.

    I removed the space and added runat="server" like this:
    <a href="~/CoyneWebServices/FileMaintenance/Warehouses.aspx" title="More
    info" runat="server">&raquo; more</a>

    This still does not work. The source view does not allow it. When i hover
    the mouse pointer over it, it says "File
    '~/coynewebservices/filemaintenance/warehouses.aspx' was not found."

    Thanks,
    Tony

    "Göran Andersson" <> wrote in message
    news:...
    > Tony Girgenti wrote:
    >> Hello.
    >>
    >> I have an ASP.NET 2.0 web site with a master page that works fine when i
    >> test it in VS2005, but when i upload it to a live isp site, it gives the
    >> error at the end of this post for one of the links. Here is the line
    >> that has the link:
    >> <div class="readmore"><a href="/CoyneWebServices/File
    >> Maintenance/Warehouses.aspx" title="More info">&raquo; more</a></div>
    >>
    >> I tried putting a tilde"~" after the href=", but it won't allow that line
    >> in the source view.

    >
    > You need to put runat="server" in the tag to be able to use the tilde. The
    > server translates the tilde url to an actual url, so the control has to be
    > a server control.
    >
    > <a href="~/CoyneWebServices/File%20Maintenance/Warehouses.aspx"
    > title="More info" runat="server">&raquo; more</a>
    >
    > As mark mentioned, an URL should not contain spaces. Although most
    > browsers doesn't care, a correct URL may not contain spaces.
    >
    > --
    > Göran Andersson
    > _____
    > http://www.guffa.com
     
    Tony Girgenti, Aug 6, 2007
    #8
  9. "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
    news:%...
    > Hello ThatsIT.
    >
    > Using your logic, if i have off of the root
    > "FileMaintenance/Warehouses.aspx"(i removed the space), from the
    > AppMaster.master(which is in the root), i use
    > <a href="/FileMaintenance/Warehouses.aspx" title="More info">&raquo;
    > more</a>
    >
    > This works OK when uploaded to live site, but does not work when i run it
    > from VS2005.
    >
    > Why is that?



    FileMaintenance/Warehouses.aspx

    is relitive from where you lcik the link

    /FileMaintenance/Warehouses.aspx

    is from the root always

    >
    > Thanks,
    > Tony
    >
    > "ThatsIT.net.au" <me@thatsit> wrote in message
    > news:...
    >> /CoyneWebServices/File Maintenance/Warehouses.aspx
    >>
    >> your link starts with a "/" this means "CoyneWebServices" is a folder in
    >> the root directory, but this may not be the case on your isp.
    >>
    >> You may need to use the "../../" addressing
    >>
    >> if you have say
    >> /folder1/folder2
    >>
    >> and
    >> /folder3/folder4
    >>
    >> and you had a file in folder4 that linked to a file in folder2 you would
    >> use
    >>
    >> ../../folder1/folder2
    >>
    >> and you had a file in folder3 that linked to a file in folder2 you would
    >> use
    >>
    >> ../folder1/folder2
    >>
    >> "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
    >> news:ORjt1%...
    >>> Hello.
    >>>
    >>> I have an ASP.NET 2.0 web site with a master page that works fine when i
    >>> test it in VS2005, but when i upload it to a live isp site, it gives the
    >>> error at the end of this post for one of the links. Here is the line
    >>> that has the link:
    >>> <div class="readmore"><a href="/CoyneWebServices/File
    >>> Maintenance/Warehouses.aspx" title="More info">&raquo; more</a></div>
    >>>
    >>> I tried putting a tilde"~" after the href=", but it won't allow that
    >>> line in the source view.
    >>>
    >>> I also tried using:
    >>> <div class="readmore"><a href="CoyneWebServices/File
    >>> Maintenance/Warehouses.aspx" title="More info">&raquo; more</a></div>
    >>>
    >>> <div class="readmore"><a
    >>> href="http://www.tonygirgenti.info/CoyneWebServices/File
    >>> Maintenance/Warehouses.aspx" title="More info">&raquo; more</a></div>
    >>>
    >>> <div class="readmore"><a href="/File Maintenance/Warehouses.aspx"
    >>> title="More info">&raquo; more</a></div>
    >>>
    >>> Any help would be gratefully appreciated.
    >>>
    >>> Thanks,
    >>> Tony
    >>>
    >>>
    >>>
    >>> Server Error in '/' Application.
    >>> --------------------------------------------------------------------------------
    >>>
    >>> The resource cannot be found.
    >>> Description: HTTP 404. The resource you are looking for (or one of its
    >>> dependencies) could have been removed, had its name changed, or is
    >>> temporarily unavailable. Please review the following URL and make sure
    >>> that it is spelled correctly.
    >>>
    >>> Requested URL: /CoyneWebServices/File Maintenance/Warehouses.aspx
    >>>
    >>>
    >>>
    >>>
    >>> --------------------------------------------------------------------------------
    >>>
    >>> Version Information: Microsoft .NET Framework Version:2.0.50727.42;
    >>> ASP.NET Version:2.0.50727.210
    >>>
    >>>

    >>
    >>

    >
    >
     
    ThatsIT.net.au, Aug 6, 2007
    #9
  10. Tony Girgenti wrote:
    > Hello Goran.
    >
    > I removed the space and added runat="server" like this:
    > <a href="~/CoyneWebServices/FileMaintenance/Warehouses.aspx" title="More
    > info" runat="server">&raquo; more</a>
    >
    > This still does not work. The source view does not allow it. When i hover
    > the mouse pointer over it, it says "File
    > '~/coynewebservices/filemaintenance/warehouses.aspx' was not found."
    >
    > Thanks,
    > Tony
    >


    Acccording to your other posts in the thread, the CoyneWebServices is
    not a folder in your solution.

    The tilde represents the root folder in your application, not the root
    folder of the web, so you should remove CoyneWebServices from the url.

    --
    Göran Andersson
    _____
    http://www.guffa.com
     
    =?ISO-8859-1?Q?G=F6ran_Andersson?=, Aug 6, 2007
    #10
  11. Ahh. I see. So "CoyneWebServices" is represented by the tilde.

    Thanks,
    Tony

    "Göran Andersson" <> wrote in message
    news:%...
    > Tony Girgenti wrote:
    >> Hello Goran.
    >>
    >> I removed the space and added runat="server" like this:
    >> <a href="~/CoyneWebServices/FileMaintenance/Warehouses.aspx" title="More
    >> info" runat="server">&raquo; more</a>
    >>
    >> This still does not work. The source view does not allow it. When i
    >> hover the mouse pointer over it, it says "File
    >> '~/coynewebservices/filemaintenance/warehouses.aspx' was not found."
    >>
    >> Thanks,
    >> Tony
    >>

    >
    > Acccording to your other posts in the thread, the CoyneWebServices is not
    > a folder in your solution.
    >
    > The tilde represents the root folder in your application, not the root
    > folder of the web, so you should remove CoyneWebServices from the url.
    >
    > --
    > Göran Andersson
    > _____
    > http://www.guffa.com
     
    Tony Girgenti, Aug 8, 2007
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?amhpbGw=?=
    Replies:
    3
    Views:
    2,543
    larsinet
    Dec 29, 2004
  2. Steve M
    Replies:
    3
    Views:
    39,938
  3. Replies:
    0
    Views:
    524
  4. BobbyOwens
    Replies:
    0
    Views:
    306
    BobbyOwens
    Feb 5, 2009
  5. kelvlam
    Replies:
    6
    Views:
    376
    kelvlam
    Jul 18, 2006
Loading...

Share This Page