MVC 4中的路由和URL技巧 [英] Routing and URL tricks in MVC 4

查看:73
本文介绍了MVC 4中的路由和URL技巧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://demo.nopcommerce.com/desktops [ ^ ]



http://demo.nopcommerce.com/build-your-own-computer [ ^ ]



http://demo.nopcommerce.com/hp-pavilion-artist-edition-dv2890nr-141-inch-laptop [ ^ ]



http://demo.nopcommerce。 com / 25-虚拟礼品卡 [ ^ ]





看这个链接第一个桌面类别的显示产品。

和另外3个是产品详细信息页面链接。

但我认为这些链接中没有控制器和动作。



任何人都可以解释如何执行此操作。

http://demo.nopcommerce.com/desktops[^]

http://demo.nopcommerce.com/build-your-own-computer[^]

http://demo.nopcommerce.com/hp-pavilion-artist-edition-dv2890nr-141-inch-laptop[^]

http://demo.nopcommerce.com/25-virtual-gift-card[^]


look this link first one display product of desktop category.
and another 3 is product details page link.
but I think there is no controller and action in these links.

can anybody explain how to do this.

推荐答案

你首先需要了解路由,就像在默认路由中有默认控制器的主页和动作是索引





在上面的例子中,所有人都专注于控制器(桌面)和他们在路由中定义的索引(无论如何)中的动作







你可以理解这个链接中的路由





ASP.NET MVC中的路由基础知识 [ ^ ]
you first need to understand routing like in default routing there is default controller of home and action is index


in the examples above all are focusing on controller like (desktops) and the action in index(whatever) they have defined in their routing



you can understand routing in this link


Routing Basics in ASP.NET MVC[^]


这篇关于MVC 4中的路由和URL技巧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆