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

The Archive Base Latest Questions

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

I created a dynamic object like below: dynamic myObject = new { DisplayName =

  • 0

I created a dynamic object like below:

dynamic myObject = new
{
    DisplayName = "Mahesh"
}; 



Content = Parse("Main", myObject);

debug section

Then I parsed it for Razor template. But it doesnt work because of the object cannot access to its properties. What is the problem here ?

Thanks in advance,

  • 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-25T10:27:03+00:00Added an answer on May 25, 2026 at 10:27 am

    The anonymous type has some accessibility issues, in that dynamic via the c# provider tries to respect accessibility. An anonymous type in a different module is not accessible (and remember that MVC pages will typically compile into a different module), hence no properties.

    IIRC, however, this is actually fixed in a later MVC patch – I seem to remember hitting this when my local machine was a rev higher than our dev-server, meaning: it worked locally on the higher revision, but failed as you describe on the dev-server.

    The ExpandoObject does not suffer this because it does not use the c# provider (it implements IDynamicMetaObjectProvider instead), and has no concept of accessibility (it simply maps member-names to the dictionary).

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

Sidebar

Related Questions

I studied polymorphism and understand that it can do dynamic method binding like below.
I've created a new web site based on the 'Dynamic Data Site' template. Three
I want to create dynamic content based on this. I know it's somewhere, as
I am trying to create a new contact using Dynamic Entity. The sample i
I'd like to be able to do something like the following: dynamic a =
Is there a way to pass a newly created object(not saved yet) to another
I have the following code which creates a dynamic object that is assigned to
I am trying to create a dynamic selector and dump view the resulting object
Does python have the ability to create dynamic keywords? For example: qset.filter(min_price__usd__range=(min_price, max_price)) I
I'm trying to create a dynamic popup window that is able to be re-sized.

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.