0
我能为这样ASP.Net MVC 3..0 Razor属性值?
public string MyProperty { get { return _GetValue(); } set { _GetValue(); } }
public static string _GetValue()
{
string name = null;
using (HROEF.Entities context = new HROEF.Entities())
{
var result = (from my linq Statement).First().ToString();
name = result;
}
return name;
}
属性设置值在我看来
@Html.DisplayFor(model=>Model.MyProperty)
有什么事错在这?
它不显示在我看来的价值
任何帮助吗?
这是有道理的。因为当我在属性中写入linq查询时它第一次工作,但后来它停止显示。任何通知不使用这种方法的方法。 – HaBo