0

I want to build a sitemap for my site but i have a problem on how to write the url in every url in my site i add a number (auto incremental number).

For example this is my site: www.example.com

when the user enter to the site get an id, like a: www.example.com/?i=1 and when he enter any inner page he will get the same parameter, such as: www.example.com/result/?i=1

but when other user enter to the site he will get i=2, and etc ...

How can i build a sitemap like this ?

Thank you

dr_sd2001
  • 25
  • 7

1 Answers1

0

For URLs that have parameters, you can use preservedRouteParameters to force any value for certain parameters to match. This allows you to use querystring and route parameters in your URLs that don't actually pertain to the page.

<mvcSiteMapNode title="Some Page" controller="Home" action="About" preservedRouteParameters="id"/>

This will make the node match each of the following URLs.

Do note that this is typically only desirable in cases where the "id" has nothing to do with identifying the page. For page (or record) identifiers, you should create a node for every "id" using a dynamic node provider or by implementing ISiteMapNodeProvider.

See this answer for more information.

Community
  • 1
  • 1
NightOwl888
  • 55,572
  • 24
  • 139
  • 212