I am going to study the structure ASP.NET MVCfor the upcoming project. Can I use advanced routing to create long URLs based on a hierarchy of site maps?
ASP.NET MVC
An example of a navigation path:
Home> Shop> Products> Home Appliances> Kitchen> Cookware> Cookers> Nonstick
Typical (I think) MVC URL:http://example.com/products/category/NonstickCooksets
Desired URL:http://example.com/shop/products/household/kitchen/cookware/cooksets/nonstick
Can I do it?
, , . biggie, MVC Preview 3 ( , 3 4), .
,
"{}/{}/{* categoryPath}"
URL-, :
http://example.com/shop/products/household/kitchen/cookware/cooksets/nonstick
ShopController Products:
public class ShopController : Controller { ... public ActionResult Products(string categoryPath) { // the categoryPath value would be // "household/kitchen/cookware/cooksets/nonstick". Process it (for ex. split it) // and then decide what you do.. return View(); }
MVC , , , . , " ", "shop/products", "{category}/{subcategory}/{specialty}" ..
, , , . , URL- MVC, , , , .
- , Action, Id , , , , .
Source: https://habr.com/ru/post/1696437/More articles:Managed hosting for hosting and continuous integration with CVSDude and CruiseControl.net - version-controlHow to get Pro * C to handle the #warning directives? - cIs it possible to disable the input of commands in the search window of the toolbar? - visual-studioDrawing a hierarchy of views in a specific context in Cocoa - objective-cTree-based (HTML based) web platform? - javascriptImage of a loop button in C # - c #UltraWebGrid: how to use a drop-down list in a column - c #In any case, disable client-side validation for the dojo date text field? - javascriptHow to create ASCII codes 2 and 3 on the Bash command line? - linuxIs this YAML? - validationAll Articles