2

I'm trying to use Url Routing within my existing ASP.NET WebForms site. Thanks to: this link, I got it working. Now I'm trying to use a SiteMap along with my routing.

I have a page MyReport.aspx. It is in the SiteMap and accessing the page directly, works fine. I've added a route for /report/{param1}/{param2}. I was hoping the sitemap would resolve the route path (MyReport.aspx) instead of /report/{param1}/{param2}, but no dice.

I have seen examples of using the SiteMap with MVC, but this makes assumptions about having controllers and such, none of which exist with a standard webform.

The approach I'm trying now is to retrieve the actual page within a custom SiteMapProvider, but I'm not seeing a way to do this. Is there a way to get the actual ASPX page instead of the Url from the HttpContext?

Thanks, -Damien

4

1 回答 1

0

Damien - 我最近发布了一个可能有用的示例。谷歌搜索“asp.net 路由站点地图”应该可以让你到达那里(只是刚刚加入所以不能发布链接)。

仅供参考,您可以使用 SiteMap.SiteMapResolve 事件而不是创建自定义 SiteMapProvider(至少对于简单的场景)。

希望能帮助到你!

于 2009-05-20T05:03:46.800 回答