none
Regarding URL rewriting RRS feed

  • Question

  • I have an application that uses friendly url mapping.  I have a link "my address book" which the mapping is defined in the web.config file
    as 
    <add key="/addressBook" value="/accounts/addressBook.aspx" />
    so when I click on the link it goes to the page and url displays as http://localhost/addressBook

    in this page there is a button to add new address

    when I click on the button it suppose to go to addressnew.aspx
    instead.. it just displays http://localhost/addressBook.aspx so the page cannot be found ( there is no page like that)
    I can't even get to the break piont with this button click event, when I click it jst puts the url and erros out.

    When I enter the whole address as http://localhost/accounts/addressBook.aspx and click on the add new button it works fine.
    Now I can hit the break point.

    I am not sure what I am doing wrong. It would be nice if someone can give me some suggestions or how or where I can find out the how the url is generated

    thanks,


    Disscussion Forum
    Wednesday, February 11, 2009 10:09 PM

Answers

  • You can use root-relative path "~/accounts/addressBook.aspx" instead of relative path "/accounts/addressBook.aspx".

    For more information, please see ASP.NET Web Site Paths:
    http://msdn.microsoft.com/en-us/library/ms178116.aspx

    Thanks.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. http://forums.msdn.microsoft.com/en-US/vssetup/thread/60424309-bd78-4ca2-b618-03c4a16123b6
    • Edited by Figo Fei Friday, February 13, 2009 7:21 AM typo
    • Marked as answer by Figo Fei Tuesday, February 17, 2009 3:47 AM
    Friday, February 13, 2009 7:13 AM

All replies

  • You can use root-relative path "~/accounts/addressBook.aspx" instead of relative path "/accounts/addressBook.aspx".

    For more information, please see ASP.NET Web Site Paths:
    http://msdn.microsoft.com/en-us/library/ms178116.aspx

    Thanks.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. http://forums.msdn.microsoft.com/en-US/vssetup/thread/60424309-bd78-4ca2-b618-03c4a16123b6
    • Edited by Figo Fei Friday, February 13, 2009 7:21 AM typo
    • Marked as answer by Figo Fei Tuesday, February 17, 2009 3:47 AM
    Friday, February 13, 2009 7:13 AM
  • By the way the right forum should be forums.asp.net

    Thanks.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. http://forums.msdn.microsoft.com/en-US/vssetup/thread/60424309-bd78-4ca2-b618-03c4a16123b6
    Friday, February 13, 2009 7:36 AM