我正在開發一個應用程序,如博客引擎。在一個主頁的觀點,我有一個鏈接作爲實現博客條目鏈接
<a href="/Blog/BlogEntry/2013/05/22/title for this blog entry" />
當鏈接,用戶點擊它會在博客控制器和運行BlogEntry動作有
public class BlogController : Controller {
public ActionResult BlogEntry(string title, DateTime createdDate) {
// doing something
var viewModel = something here for build the view model
return View(viewModel);
}
}
問題是如何我可以這樣做嗎?
感謝您的評論。但我想提交到像BlogEntry(字符串標題,日期時間createdDate)功能。這是我的要求。 – thangchung
@ThangChung我已經更新了我的解決方案,使用actionfilter來填充CreatedDate和標題,只要你想。請看一看。 – Devesh
優秀的人。現在正在工作。謝謝 – thangchung