[align=left]
public ArrayList arl = new ArrayList(); //我在这里定义了一个全局数组
public void Fill(ArrayList sdf)
{
ArrayList ar = sdf;
Model.stock stockInfo = null;
for (int i = 0; i < ar.Count; i++)
{
stockInfo = Bll.Stock.GetStockByUUID(ar[i].ToString());
HtmlTextArea ht = new HtmlTextArea();
ht.ID =stockInfo.uuid;
arl.Add(ht.ID); //把我需要的内容添加进去
ht.InnerText = stockInfo.re;
Panel1.Controls.Add(ht);
}
}
public void Button()
{
Model.stock stockInfo = null;
for (int i = 0; i < arl.Count; i++) //在这里我去得不到他的值?显示的是为空
{
stockInfo = Bll.Stock.GetStockByUUID(arl[i].ToString());
string uuuid = stockInfo.uuid;
string vre = stockInfo.re;
this.Page.GetType().InvokeMember("ReadUCMessage", BindingFlags.InvokeMethod, null, this.Page, new object[] { uuuid, vre});
}
}[/align]这是怎么回事?把上面的数组带到下面来确是为空的 没有数据
说明:这是ascx页面的代码?我要在aspx中得到遍历出来的内容
或者可以把这个数组带到aspx中进行判断赋值?
这要怎么做?全局变量
public ArrayList arl = new ArrayList(); //我在这里定义了一个全局数组
public void Fill(ArrayList sdf)
{
ArrayList ar = sdf;
Model.stock stockInfo = null;
for (int i = 0; i < ar.Count; i++)
{
stockInfo = Bll.Stock.GetStockByUUID(ar[i].ToString());
HtmlTextArea ht = new HtmlTextArea();
ht.ID =stockInfo.uuid;
arl.Add(ht.ID); //把我需要的内容添加进去
ht.InnerText = stockInfo.re;
Panel1.Controls.Add(ht);
}
}
public void Button()
{
Model.stock stockInfo = null;
for (int i = 0; i < arl.Count; i++) //在这里我去得不到他的值?显示的是为空
{
stockInfo = Bll.Stock.GetStockByUUID(arl[i].ToString());
string uuuid = stockInfo.uuid;
string vre = stockInfo.re;
this.Page.GetType().InvokeMember("ReadUCMessage", BindingFlags.InvokeMethod, null, this.Page, new object[] { uuuid, vre});
}
}[/align]这是怎么回事?把上面的数组带到下面来确是为空的 没有数据
说明:这是ascx页面的代码?我要在aspx中得到遍历出来的内容
或者可以把这个数组带到aspx中进行判断赋值?
这要怎么做?全局变量
{
this.Fill(sdf); //这个sdf报错 这个sdf哪里来?
Model.stock stockInfo = null;
for (int i = 0; i < arl.Count; i++)
{
stockInfo = Bll.Stock.GetStockByUUID(arl[i].ToString());
string uuuid = stockInfo.uuid;
string vre = stockInfo.re;
Response.Write("<script>alert('编号为" + uuuid + "内容为" + vre + "')</script>");
this.Page.GetType().InvokeMember("ReadUCMessage", BindingFlags.InvokeMethod, null, this.Page, new object[] { uuuid, vre});
}
}[/align]