Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'object' does not contain a definition for 'id' why? #572

Open
yuanfeng-net opened this issue Jul 24, 2020 · 1 comment
Open

'object' does not contain a definition for 'id' why? #572

yuanfeng-net opened this issue Jul 24, 2020 · 1 comment

Comments

@yuanfeng-net
Copy link

yuanfeng-net commented Jul 24, 2020

dynamic viewBag = new DynamicViewBag();

viewBag.Item=new {id=100,name="testItem" };

var model=new PageDetail(){};

RunCompile('

@ViewBag.Item.id
', 'testitemid',
model.GetType(),
model,
(DynamicViewBag)viewBag);

Microsoft.CSharp.RuntimeBinder.RuntimeBinderException:“'object' does not contain a definition for 'id'”

@yuanfeng-net
Copy link
Author

Could you tell me how to solve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant