0

I try use syntax shown in this Post but I still getting errors like:

Invalid expression, RouteUrlExpressionBuilder expects a string with format: RouteName=route,Key1=Value1,Key2=Value2.

My route and link are:

routes.MapPageRoute("about", "about/", "~/About.aspx");

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="<%$RouteUrl:about%>">About</asp:HyperLink>

Could u tell my what I doing wrong?

Community
  • 1
  • 1
Karter
  • 43
  • 1
  • 8
  • One of my routes looks e.g. like `routes.MapPageRoute(@"01", @"start", @"~/ui/mainwindow/start/index.aspx", true);`. So maybe adding the boolean parameter might help? – Uwe Keim Jun 30 '14 at 18:41
  • Not rly still have the same error. – Karter Jun 30 '14 at 19:22

1 Answers1

0

As error mentioned, we need to have register some thing like this

routes.MapPageRoute(
                "about",
                "about/{Name}",
                "~/About.aspx"
            );

Then master page should be like:

<asp:MenuItem NavigateUrl="<%$RouteUrl:Name=Test %>" Text="About" /> 
  • But I have one section "About" on my site and I don't want to give any parameter. Somthing like Home / News / Contact / About – Karter Jun 30 '14 at 19:05
  • If I use only pure text "about" this working correctly. I don't know why. – Karter Jun 30 '14 at 21:09