1
私の質問はとても簡単です。動的表現でHtml.LabelForを使用するには?
オブジェクト内のすべてのプロパティ値に対して実行します。例:
public class Product
{
public int ProductId {get;set;}
public string Name {get;set;}
public string Content {get;set;}
}
var obj = new Product();
var props = obj.GetType().GetProperties();
foreach(var prop in props)
{
@Html.LabelFor(.......) // Need to run for active property.
// such as @Html.LabelFor(x => prop)
}
私は何をしたいのですか?この方法あるいは他の方法、
これをしようとしていないが、あなたに@Peterをありがとうございます。実行中です。 – sinanakyazici
優秀...私は助けてうれしい – Peter