怎样取出list中的对象属性值? IList list = ParameterManager.GetParametersByproductId(productId);我已经通过一个方法将对象放入list中,现在如何用循环取出对象,以及对象中的属性值? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 foreach(object obj in list){ //todo} 请大家给我指点指点,源码如下……IList<Parameters> list = ParameterManager.GetParametersByproductId(productId); for (int i = 1; i <= list.Count; i++) { Parameters parameters=list[i]; TextBox txtparameter = (TextBox)Master.FindControl("ContentPlaceHolder1").FindControl("tbParameter").FindControl("txtParameter" + i.ToString()); txtparameter.Text = parameters.ProductId; TextBox txtunit = (TextBox)Master.FindControl("ContentPlaceHolder1").FindControl("tbParameter").FindControl("txtUnit" + i.ToString()); txtunit.Text = parameters.Unit; TextBox txtstandard = (TextBox)Master.FindControl("ContentPlaceHolder1").FindControl("tbParameter").FindControl("txtstandard" + i.ToString()); txtstandard.Text = parameters.Standard; } txtparameter.Text = parameters.ProductId.ToString();这句提示错误:未将对象引用设置到对象的实例。 不要使用这个接口,已经逐步不使用了。使用泛型接口就可以达到你的要求了。IList<你的类型> list = ParameterManager.GetParametersByproductId(productId); 用C#开发一个类似于千千静听的播放器 static静态方法 边输入边过滤,并不要等失去焦点的时候再过滤?请假高手. 打印一个有规律的数字图形 求救post方法 很傻的问题 C# 中怎么取当前时间? 請高手解決一個低手問題,如何表示這個數組 c#会员编号规则 Socket连接的释放问题(端口一直占用!!) 字符串类型的属性问题 可以帮我解决吗??C#的 .NET 下 如何生成scr文件
{
//todo
}
IList<Parameters> list = ParameterManager.GetParametersByproductId(productId);
for (int i = 1; i <= list.Count; i++)
{
Parameters parameters=list[i];
TextBox txtparameter = (TextBox)Master.FindControl("ContentPlaceHolder1").FindControl("tbParameter").FindControl("txtParameter" + i.ToString());
txtparameter.Text = parameters.ProductId;
TextBox txtunit = (TextBox)Master.FindControl("ContentPlaceHolder1").FindControl("tbParameter").FindControl("txtUnit" + i.ToString());
txtunit.Text = parameters.Unit;
TextBox txtstandard = (TextBox)Master.FindControl("ContentPlaceHolder1").FindControl("tbParameter").FindControl("txtstandard" + i.ToString());
txtstandard.Text = parameters.Standard;
}
这句提示错误:未将对象引用设置到对象的实例。
IList<你的类型> list = ParameterManager.GetParametersByproductId(productId);