Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7727565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:29:28+00:00 2026-06-01T05:29:28+00:00

I created a custom module for Orchard following this wonderful guide . I have

  • 0

I created a custom module for Orchard following this wonderful guide.

I have created a controller called BarberAdminController as follows:

[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);
    } 
}

View:

@{ 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)
}

Upon clicking the link from the admin menu to create a Barber, I get a blank page with nothing but a “Save” button. (URL: /Admin/BarberShop/Barbers/Create)

Does anyone know what I might be doing wrong?

I’ve set up the routes and admin links and they seem to work fine. I followed the guide as closely as I could on creating the Drivers and Handlers for BarberPart correctly. Including down to the Migration.cs file database schema.

Any help would be great!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:29:29+00:00Added an answer on June 1, 2026 at 5:29 am

    I figured it out.

    I needed to define a Content Part and Content Type for BarberPart. In Migrations.cs, do:

    ContentDefinitionManager.AlterPartDefinition(typeof(BarberPart).Name, p => p
                .Attachable(false));
    ContentDefinitionManager.AlterTypeDefinition("Barber", t => t
                .WithPart(typeof(BarberPart).Name));
    

    In the “Create” method of the Controller, replace:

    var barber = _services.ContentManager.New(typeof(BarberPart).ToString());
    

    with:

    BarberPart barber = _services.ContentManager.New<BarberPart>("Barber");
    

    Make sure that you have a Drivers/BarberDriver.cs file as such:

    public class BarberDriver : ContentPartDriver<BarberPart> 
    {
        protected override DriverResult Editor(BarberPart part, dynamic shapeHelper)
        {
            return ContentShape("Parts_Barber_Edit", () => shapeHelper.EditorTemplate(TemplateName: "Parts/Barber", Model: part, Prefix: Prefix));
        }
    
        protected override DriverResult Editor(BarberPart part, IUpdateModel updater, dynamic shapeHelper)
        {
            updater.TryUpdateModel(part, Prefix, null, null);
            return Editor(part, shapeHelper);
        }
    }
    

    Be sure to have a part edit template located in /Views/EditorTemplates/Parts/Barber.cshtml that looks like this:

    @model SDKU.Barbr.Models.BarberPart
    
    <fieldset>
        @Html.EditorFor(model => model.SomePropertyName)
        etc...
    </fieldset>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 modules: default and admin. For default module I created custom and
I have a custom module. Migrations.cs looks like this. public int Create() { SchemaBuilder.CreateTable(MyModuleRecord,
I have created a custom Rewrite Provider for IIS 7 following instructions in this
I've created a custom module citation for academic references. Citations have, among other things,
I have created custom jQuery UI widget called uiPopover, very similar to UI-dialog (in
friends, i have created custom title bar using following titlebar.xml file with code <?xml
Following the example of writing a custom django-admin command here , I've created the
I have created a custom module and am using hook_block to programmatically create some
I am creating a custom module in magento.I have created block class and phtml
I have created a new module in Orchard CMS, i have a new event

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.