Razor View Engine : An expression tree may not contain a dynamic operation

后端 未结 7 1834
不思量自难忘°
不思量自难忘° 2020-11-28 08:50

I have a model similar to this:

public class SampleModel
{
     public Product Product { get; set; } 
}

And in my controller I get an excep

相关标签:
7条回答
  • 2020-11-28 09:46

    Before using (strongly type html helper into view) this line

    @Html.TextBoxFor(p => p.Product.Name)
    

    You should include your model into you page for making strongly type view.

    @model SampleModel
    
    0 讨论(0)
提交回复
热议问题