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