asp.net webforms routing: optional parameters

前端 未结 3 489
深忆病人
深忆病人 2020-12-10 13:21

I want to add optional parameters in my routing table. For example I would like the users to browse a product catalog like this: http://www.domain.com/browse/by-category/el

3条回答
  •  抹茶落季
    2020-12-10 13:59

    I'd just create the separate route.

    That said, you could define a custom RouteHandler that based on some convention you define, automatically send those special cases as if you had a different route.

    Alternatively you could use the custom RouteHandler along with a convention, to avoid having to specify the specific page in your routes. That's the equivalent of what asp.net MVC does.

提交回复
热议问题