我正在开发一个应用程序,如博客引擎。在一个主页的观点,我有一个链接作为实现博客条目链接
<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