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 7708139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:32:03+00:00 2026-06-01T00:32:03+00:00

using Orchard.ContentManagement; using Orchard.ContentManagement.Drivers; namespace Orchard.Webshop.Drivers { public class ProductDriver : ContentPartDriver<ProductPart> { protected

  • 0
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;

namespace Orchard.Webshop.Drivers {
    public class ProductDriver : ContentPartDriver<ProductPart> {
        protected override DriverResult Editor(ProductPart part, dynamic shapeHelper)
        {
            return ContentShape("Parts_Product_Edit", () => shapeHelper.EditorTemplate(TemplateName: "Parts/Product", Model: part, Prefix: Prefix));
        }

        protected override DriverResult Editor(ProductPart part, IUpdateModel updater, dynamic shapeHelper)
        {
            updater.TryUpdateModel(part, Prefix, null, null);
            return Editor(part, shapeHelper);
        }
    }
}

I’ve been searching for what the Prefix does, but haven’t found anything that defines it or explains its purpose. And if the Prefix can be used in methods other than Editor, please feel free to elborate on that as well. Thank you.

  • 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-01T00:32:05+00:00Added an answer on June 1, 2026 at 12:32 am

    It is a string prefix that gets appended to the form field names in of the editor templates. The reason this is needed:

    Lets say you create a new content part, named NoobsPart, with a property called “Text”. And in the “N00b” content type that contains N00bsPart, you also attach a BodyPart. The BodyPart also has a property called “Text”. The html field names of BodyPart and N00bsPart would clash with each other on postback. The prefix solves the problem of the field names clashing. Generally the prefix can be set to the part name to disambiguate and avoid the clash. I’m not sure if the Prefix is used anywhere else, but given the problem it solves, I would think not.

    Following examples in Orchard core code, I usually set prefix as a class property in the driver:

    using Orchard.ContentManagement;
    using Orchard.ContentManagement.Drivers;
    
    namespace Orchard.Webshop.Drivers {
        public class ProductDriver : ContentPartDriver<ProductPart> {
            protected override string Prefix { get { return "ProductPart"; } }
            protected override DriverResult Editor(ProductPart part, dynamic shapeHelper)
            {
                return ContentShape("Parts_Product_Edit", () => shapeHelper.EditorTemplate(TemplateName: "Parts/Product", Model: part, Prefix: Prefix));
            }
    
            protected override DriverResult Editor(ProductPart part, IUpdateModel updater, dynamic shapeHelper)
            {
                updater.TryUpdateModel(part, Prefix, null, null);
                return Editor(part, shapeHelper);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm using WCF WebAPI Preview 6 within my application (Orchard CMS). I'm trying
Using orchard 1.3.9 I made a simple HelloWorld module. That module has a reference
We're creating a page in Orchard CMS using the 'List' Content Type. We want
I am using MvcMailer with Orchard CMS in a module I created, and although
Using http://docs.orchardproject.net/Documentation/Deploying-Orchard-to-Windows-Azure I've successfully deployed Orchard into Azure. After every 20mins or so without
Using Orchard CMS 1.4.2, I'm having trouble posting a form in my custom module.
I've created a basic website using the Orchard CMS, and attempted to deploy it
I am creating a website using Orchard CMS and I have an external .NET
I work on a project where we're considering using Orchard CMS . However, we
I made a Website with Orchard. Links are using no page names. A link

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.