オーチャードのカスタムモジュールをthis wonderful guideの後に作成しました。次のように私は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)
}
理容室を作成するために、管理者メニューからリンクをクリックすると、私は何も空白のページを取得します「保存」ボタンがあります。 (URL:/ Admin/BarberShop/Barbers/Create)
私は何が間違っているかもしれないか知っていますか?
私はルートと管理リンクを設定していますが、正常に動作しているようです。 BarberPartのドライバとハンドラを正しく作成するために、私ができる限りガイドに従った。 Migration.csファイルデータベーススキーマまでを含む。
助けがあれば助かります。
多分配置がありません。このようになります/Views/EditorTemplates/Parts/Barber.cshtmlに位置する部分の編集テンプレートを持つようにしてください? –