Configure ASP.NET WebForms Rotation

2

Good afternoon, I have an ASP.NET application in WebForms (still) working normally, the client asked to include the date in the route of a new page, I created the route like this:

  routes.MapPageRoute(
         "RevendaMapRoute",
         "Revendas/{data}/{idnome}",
         "~/Revendas.aspx", false,null,
          new RouteValueDictionary { {"data", @"\d{2}/\d{2}/\d{4}"},{ "idnome", "[a-z0-9 -]*" } });´´´´

In Page_load .cs I retrieve the URL like this:

            var rt = RouteData.Route as Route;
            if (rt != null && rt.Url == "Revendas/{data}/{idnome}")
            {}´´

The call to the route:

<a href='<%#: GetRouteUrl("RevendaMapRoute", new { data = Item.DATA, idnome = Item.NOME_REVENDA_ROUTE}) %>'><%#: Item.NOME_REVENDA %></a>´´

When I click on the link the return is 404 non existent page ... I believe that the normal '/' bar on the date is not identifying the route correctly, as as I said without the date on the route it works normally. Thanks for any help.

    
asked by anonymous 02.09.2017 / 18:15

0 answers