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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:35:33+00:00 2026-05-26T13:35:33+00:00

I’m trying to create a plugin for nopCommerce v2.20 that allows the user to

  • 0

I’m trying to create a plugin for nopCommerce v2.20 that allows the user to request a quote for goods and services by describing the requirements and attaching any relevant documents.

I have started by using http://blog.csharpwebdeveloper.com/2011/09/10/writing-a-plugin-for-nopcommerce-2-x/ as a guide, this has been very good so far. My project is almost identical to the one in the blog post so I’ll only add code snippets as I think they are required, so please ask me to expand and provide details if I have left anything important out.

Now I want to add a facility to upload multiple files using uploadify and have decided based on the existing code that I should create an EditorTemplate for attachments.

My problem is I can’t work out how to setup my template in a way that can be located by the MVC framework when I use the following line of code to get the template.

@Html.EditorFor(m => m.Attachment)

In my model I’m using the UIHintAttribute(“Attachments”) on the Attachment property to identify the template with no noticeable effect.

I have created a folder below the “Views” folder called “EditorTemplates” and added a file called “Attachments.cshtml” with the build action set to “Embedded Resource”, contents below:

@model int
@using Nop.Core;
@{
    var randomNumber = CommonHelper.GenerateRandomInteger();
    var clientId = "download" + randomNumber;
    var downloadService = EngineContext.Current.Resolve();
    var download = downloadService.GetDownloadById(Model);
}
<div>This is a download control @string.Format("randomNumber = {0}, clientId = {1}, download = {2}", randomNumber, clientId, download);</div>

I intend to implement the template once I can get the MVC framework to resolve its location.

So is it possible to have an editor template in a plugin (a separate class library from the main project) and if so what do I need to do to enable the MVC framework to resolve my template location?

I’d also like to add I’m quite new to MVC, Razor, and nopCommerce, sorry in advance if I missed something obvious.

As a side, could you suggest a better title for my question as stackoverflow tells me that it appears subjective?

thanks

  • 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-26T13:35:34+00:00Added an answer on May 26, 2026 at 1:35 pm

    If you are trying to supply an editor template without pre-compilation (which is probably the best way until you get into some more advanced scenarios) you will want to set the BuildAction as “Content” – not “EmbeddedResource”.

    Also, make sure your editor template is in one of the following directory structures (you mentioned it was under “Views” which is incorrect):

    • /Views/{ControllerName}/EditorTemplates/Attachments.cshtml
    • /Views/Shared/EditorTemplates/Attachments.cshtml
    • /Areas/{AreaName}/Views/{ControllerName}/EditorTemplates/Attachments.cshtml
    • /Areas/{AreaName}/Views/Shared/EditorTemplates/Attachments.cshtml

    If you do want to embed the templates as part of a separate library, I suggest you look at this post from Chris Van De Steeg.

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

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into

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.