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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:25:02+00:00 2026-05-30T19:25:02+00:00

I have a simple Widget that I’ve created using a ContentPart. The ContentPart has

  • 0

I have a simple Widget that I’ve created using a ContentPart. The ContentPart has the appropriate Driver, the Widget can be placed anywhere in my Orchard site and everything works great! The Widget needs to capture some data from the user, validate it, process it and then display a success response in the Widget.

To achieve this I’ve defined a controller that accepts a POST request that will process the Model and return the same MyForm view if it is invalid or return the FormSuccess view if it’s valid. The Widget Part template uses @Html.Partial("MyForm") to display the MyForm view that contains an Ajax form that will update it’s containing div with the POST response. The controller will return the MyForm view or the FormSuccess view depending on the data.

The problem that I’m having is that my designer needs to override the partial views for the MyForm view and FormSuccess view, he can easily override the Part display template but not the partial views.

I think the reason that this isn’t possible at the moment is because I’m using @Html.Partial("MyForm"). I’ve found that if I use @Display(New.MyForm()) instead, I can override the MyForm view by creating a file called MyForm.cshtml in the Views folder for the current theme, this is exactly what I need, but how do I do the equivalent for @Display in the controller action?

At the moment I’m doing return this.PartialView("MyForm", model) or return this.PartialView("FormSuccess") which is going to use the original views and not the overridden ones. I’ve noticed that there is a ShapeResult but I’m not sure if this is the right thing to do and I don’t know how to generate the dynamic constructor parameter. Also ideally I need the MyForm view to have a strongly typed model so that I can use the HtmlHelper methods LabelFor, TextboxFor and ValidationMessageFor which isn’t possible when the model is a dynamic?

Has anybody done something like this before or can anyone offer any guidance?

Thanks,
Jason

  • 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-30T19:25:03+00:00Added an answer on May 30, 2026 at 7:25 pm

    I managed to get this working by changing the way my module was being compiled! I don’t completely understand how this has worked, but it has!

    Initially I tried overriding the partial views by creating files with the same name in the views folder for the current theme, this did nothing and I’ve been trying different approaches ever since.

    What I’ve found is that if I force my module to be dynamically compiled the partial views from the themes folder override the related views in my module. Previously I was using the referenced module loader because I wanted to debug my module and this was the only way I could achieve it.

    It appears that when a module is dynamically compiled something happens that maps the views from my module to the overriding views in the theme!

    Here’s a good link that explains module loading.

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

Sidebar

Related Questions

I have a simple question really: SWT documentation says that if you're using styledText,
I have one simple widget consisting in a simple button that launches the main
I have a fileUploader widget that I'm using to select an xml file. I
I have a simple widget that plays a sound file when pressed. Right now,
I have created a battery widget that uses a Service to listen for Battery
For example, I have a super simple widget that I want to allow my
I have an existing android app. I added a simple widget to it using
I have simple win service, that executes few tasks periodically. How should I pass
I have simple SSIS package in which On Error event handler I have created
I have simple WinForms application where modifying Windows Registry. The problem is that in

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.