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

  • Home
  • SEARCH
  • 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 4031682
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:37:39+00:00 2026-05-20T11:37:39+00:00

Is it possible to distribute an EditorTemplate control ASCX along with a type in

  • 0

Is it possible to distribute an EditorTemplate control ASCX along with a type in a library project and have it be used by MVC3 when the type is rendered with the EditorFor() method?


Where I work we have a lot of DateTime, Gender and a few more custom fields which have a specific but concsistent way of (HTML) input and a corresponding backing ViewModel type for them (i.e. DateTimeViewModel with separate month, day, year field etc.) and they are in a shared library project.

However we still have to copy the EditorTemplates for these types to each project which is not very DRY.

So is there a way to bundle such EditorTemplate along with the library project and make sure that it’s used when the corresponding ViewModel is used without having to copy all EditorTemplate to every projects?

  • 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-05-20T11:37:39+00:00Added an answer on May 20, 2026 at 11:37 am

    You need a custom VirtualPathProvider to achieve this but nothing out of the box. Here’s a blog post you may take a look at.

    Disclaimer: Custom VirtualPathProviders don’t work with precompiled web applications. So if you intend to precompile your web application before shipping don’t use virtual path providers.

    Because of this limitation personally I use custom NuGet packages that allow the developers to pull all the necessary templates to their corresponding locations.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Can distribute setuptools be used to port packages implemented in python 2
Is it possible to use CodeIgniter framework in commercial project and distribute it ?
I have a library that I distribute using maven 2. The typical user of
Background : I wanted to distribute a library to some other developers (something along
Is it possible to distribute Tomcat by Java Web Start and run it from
I'm wondering if it's possible to distribute a RoR app for production use without
I have to distribute large content to be consumed by my application. The data
I have a Total value that I need to distribute among several rows in
All: My employer believes they have a legal loophole to distribute Enterprise signed apps
Is it possible to distribute app. only for selected accounts/clients on Android Market or

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.