【发布时间】:2012-04-14 16:52:42
【问题描述】:
我在 this wonderful guide 之后为 Orchard 创建了一个自定义模块。
我创建了一个名为 BarberAdminController 的控制器,如下所示:
[Admin]
public class BarberAdminController : Controller
{
...
public BarberAdminController(IOrchardServices services, IRepository<BarberPart> repository)
{
_repository = repository;
_services = services;
}
...
public ActionResult Create()
{
var barber = _services.ContentManager.New(typeof(BarberPart).ToString());
dynamic model = _services.ContentManager.BuildEditor(barber);
return View(model);
}
}
查看:
@{ Layout.Title = T("New Barber").ToString(); }
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
@Display(Model)
}
单击管理菜单中的链接以创建理发师后,我得到一个空白页面,其中只有一个“保存”按钮。 (网址:/Admin/BarberShop/Barbers/Create)
有人知道我做错了什么吗?
我已经设置了路由和管理链接,它们似乎工作正常。我尽可能地按照指南正确地为 BarberPart 创建驱动程序和处理程序。包括到 Migration.cs 文件数据库架构。
任何帮助都会很棒!
【问题讨论】:
-
可能缺少展示位置?
标签: asp.net asp.net-mvc-3 module orchardcms