All pages work correctly with routing but when selecting a menuitem (in masterpage) to go a page, it does not go to the selected page. When I enter product page with pathlocalhost:3806/yarrow/Products/35 then click on home menuitem, it gives me this path localhost:3806/yarrow/Products/Default.aspx but correct path is localhost:3806/yarrow/Default.aspx. How to fix it please
My sample code
Sub RegisterRoutes(routes As System.Web.Routing.RouteCollection)
routes.MapPageRoute("", "{DesignerID}", "~/PDesigners.aspx")
routes.MapPageRoute("", "Products/{ProductID}", "~/Product.aspx")
End Sub
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs on application startup
RegisterRoutes(System.Web.Routing.RouteTable.Routes) End Sub
This code in my user control to get id dynamic
<a href='<%# GetRouteUrl("",new with {.ProductID=Eval("ProductID")})%>' class="product-image"> <img src='UploadedImages/Products/big/<%# EVAL("PictureID")%>' alt='<%# Eval("ProductTitle") %>' width="165" height="161" /> <asp:Label ID="ProductImageLabel" runat="server" Text='<%# Eval("PictureID") %>' Visible="false" /> </a>