1
我想使它成为可能,所以如果有人试图去/内容他们被发送到一个specfic控制器(在这种情况下,内容,然后在url中的以下细节传递如MVC3路由到具有参数的特定控制器
参数的URL是http://localhost:51118/content/1/7/test.html
我曾尝试:
routes.MapRoute("content", "content", new { controller = "Content", action = "Index", id = UrlParameter.Optional });
我尝试整合CMS这就是为什么网址是它是什么
编辑:
public class ContentController : Controller
{
public ActionResult Index()
{
var model = new Content();
return View(model);
}
}
我该如何在控制器上获取ID? – Beginner
感谢它的魅力 – Beginner