Those of you who work with the Intelligencia UrlRewrite module may have encountered the following bug:
“Cannot use a leading .. to exit above the top directory”
I faced a similar problem and couldn’t find any solution to fix this. In fact it seems most approaches head to the wrong direction. Here is a short list of what you should take care of
Replace the .. in links with ~/ so the following line
<asp:HyperLink ID="HyperLink1" NavigateUrl="../MyTest.aspx" runat="server" />
should be replaced using:
<asp:HyperLink ID="HyperLink1" NavigateUrl="~/MyTest.aspx" runat="server" />
Avoid placing Images in the asp:HyperLink Control. If you want the following:
<asp:HyperLink ID="HyperLink2" NavigateUrl="http://www.dgrigoriadis.net" runat="server"> <asp:Image ID="Image1" ImageUrl="~/Images/bild1.jpg" runat="server" /> </asp:HyperLink>
While I was trying to find a solution on the web I realized that most solutions didn’t work for me and/or went a way which didn’t even had to do with the actual problem. So I took the time to split down the entire page where the error occured and finally noticed that in my case the second solution above was the cause of the error message. I had a DataList on my site which retrieved the Image url from the database and a link to another site and so I put a HyperLink control on the ItemTemplate and filled the ImageUrl property. After rewriting that part with the solution above everything went right.
Sometimes big problems are resolved using the most easy way 😉