Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys,
I am getting an error in a routed page when I click on a link that should open another routed link, but it seems that the code makes a loop I don't understand why and where.

Here the code in the global.asax
VB
Sub RegisterRoutes(ByVal routeCollection As RouteCollection)
       RouteTable.Routes.RouteExistingFiles = false
       routeCollection.Ignore("{resource}.axd/{*pathInfo}")
       routeCollection.MapPageRoute("RouteHome", "", "~/home.aspx")

       routeCollection.MapPageRoute("RouteForpage", "search/{typology}/", "~/search-by-typology.aspx", False,
                                    New RouteValueDictionary(New With {.typology = ""}))



       routeCollection.MapPageRoute("RouteArticle", "search/{articlecode}/{id}/", "~/article.aspx")
End Sub


in the murkup(search-by-typology.aspx) I added the following code

<a href='<%# GetRouteUrl("RouteArticle", new With {.articlecode= eval("articlecodeDB").tostring(), .id = eval("idDB").tostring() })  %>'>	view details </a><br />


When I click on the link I get the redirection loop error, do you have any suggestion?

thank you
Posted
Comments
JoCodes 19-Jan-14 22:43pm    
Whats the exact error message and which line is throwing?

1 solution

I was going from
search-by-typology.aspx
towards
article.aspx
but in the article's codebihind I have got a response.redirect(search-by-typology.aspx) old style redirect and it was going back so when I have commented that row the issue disappeared.
I hope this help someone else.

Thank you for your comment

Fra
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900