What might be the reason my breadcrumbs aren't shown on the page when the address is like http://localhost:53732/Details/Index/1

But it works if I manually rewrite the address like this
http://localhost:53732/Details/Index?id=1

Here is my Mvc.sitemap:
<?xml version="1.0" encoding="utf-8" ?>
<mvcSiteMap xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-3.0" enableLocalization="true">
<mvcSiteMapNode title="Home" controller="Home" action="Index">
<mvcSiteMapNode title="Listing" controller="Listing" action="Listing" key="Details">
</mvcSiteMapNode>
</mvcSiteMapNode>
</mvcSiteMap>
And here is the method which returns my View Details/Index:
namespace OurNewShop.Controllers
{
public class DetailsController : Controller
{
[MvcSiteMapNode(Title = "DetailsPage", ParentKey = "Details")]
public ActionResult Index(int id)
{
using (ProductContext context = new ProductContext())
{
Product pr = context.Products.Include(y => y.ProductImages).FirstOrDefault(y => y.ProductId == id);
ViewBag.ImagePath = Constants.Constants.ImagePath;
return View(pr);
});
}
}
}
}
What is the solution to see it?
Optional parameters must be mentioned in mvcSiteMapNode within web.sitemap in order to make the breadcrumbs and navigation work properly. Try including "id", and "preservedRouteParameters" as shown below.