我对从 ListPageObj 传递值以在标签上显示值有疑问。我怎样才能获得价值?
BLL
public List<ListPageObj> MyList(int ItemID)
{
return (from a in ctx.Item where a.ItemID == ItemIDselect new ListPageObj
{
Item1= a.Item1,
Item2= a.Item2,
Item3= a.Item3
}).ToList<ListPageObj>();
}
列表页对象
public string Item1
{ get; set; }
public string Item2
{ get; set; }
public string Item3
{ get; set; }
aspx
<asp:label id="label1" runat="server" />
<asp:label id="label2" runat="server" />
<asp:label id="label3" runat="server" />
aspx.cs ?
//code to retrieve item1, item2, item3 value from BLL
label1.Text = ListPageObj.Item1; // gives me null value
label2.Text = ListPageObj.Item2; // gives me null value
label3.Text = ListPageObj.Item3; // gives me null value