0

I am generating my routeconfig from a database.

I have a file combine.aspx which combines all data into a virtual webpage.

Right now the routing is working, however I have a problem.

I want the url to look like this:

www.domain.com/Home

This is working, however the combiner needs the pageId. How can I send this without showing it in the url? This is how the route is combined now:

 routes.MapPageRoute(
   page.pageName,
   url,
   "~/combine.aspx");
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
PieterSchool
  • 499
  • 4
  • 15

1 Answers1

2

You can use this overload of MapPageRoute: RouteCollection.MapPageRoute Method (String, String, String, Boolean, RouteValueDictionary)

Like this:

routes.MapPageRoute(
    page.pageName,
    url,
    "~/combine.aspx"
    false,
    new{ pageId = page.pageId }//or whatever variable value you want to use
);
joym8
  • 4,014
  • 3
  • 50
  • 93