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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:18:12+00:00 2026-05-17T06:18:12+00:00

I have a strongly typed Person view, that I want to render a partial

  • 0

I have a strongly typed Person view, that I want to render a partial in:

Person View (strongly typed as person)

<label for="name">Name</label>
    <% Html.RenderPartial("AddressForm"); %>
</label>

AddressForm View (untyped, because I also want to use this in the Distributor strongly typed view)

When I try to call this partial from the Person view, I get this error:

Compiler Error Message: CS1963: An expression tree may not contain a dynamic operation

Source Error:

Line 8:    </div>  
Line 9:    <div class="editor-field">  
Line 10:       <%= Html.TextBoxFor(model => model.addressLine1) %>  
Line 11:       <%: Html.ValidationMessageFor(model => model.addressLine1) %>  
Line 12:   </div> 

How can I get this partial to render so that I can use my partial addressView across multiple other types?

Edited:

// GET: /Person/Create  

public ActionResult Create()  
{
    Person person = new Person();       
    return View(person);  
}  

//Person create view  
<% Html.RenderPartial("AddressForm"); %>

//AddressForm Partial
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>

<fieldset>  
    <legend>Address</legend>   
    <div class="editor-label">  
        <label for="addressLine1" class="addressLabel">Address Line 1</label>  
    </div>  
    <div class="editor-field">  
        <%= Html.TextBoxFor(model => model.addressLine1) %>  
        <%: Html.ValidationMessageFor(model => model.addressLine1) %>
    </div>
</fieldset>

Error is above.

  • 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-17T06:18:13+00:00Added an answer on May 17, 2026 at 6:18 am

    you can’t use strongly typed helpers with dynamic viewmodel:

    you can use non strongly typed helpers instead, like this:

    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
    
    <fieldset>
    <legend>Address</legend>
    <div class="editor-label">
    <label for="addressLine1" class="addressLabel">
    Address Line 1</label>
    </div>
    <div class="editor-field">
    <%= Html.TextBox("addressLine1") %>
    <%: Html.ValidationMessage("addressLine1") %> </div>
    </fieldset>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strongly typed partial view CheckBox.ascx that renders a checkbox. This is
I have a strongly-typed Partial View that takes a ProductImage and when it is
MVC newbie question re binders. Supposing I have two strongly typed partial actions that
I have a strongly typed View class that all my UserControls derive from. It
I have a strongly typed view and want to use it in an NHaml
I have a strongly-typed view that receives a Design model for its rendering. My
I have a strongly typed partial view which is giving me Object reference not
I have a strongly typed MVC3 Razor view in which I want to display
I have a strongly typed partial view #1, and i have another partial view
I have a strongly typed view that is using a viewmodel I created. I

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.