我在页面上选择类型后修改页面ext:label的text值,然后我在后台再取该text,下面红色部分显示出来的值还是原来的值,有知道的告诉下 ,谢谢!
先赋值:
List<Ext.Net.Label> listLab = Ext.Net.Utilities.ControlUtils.FindControls<Ext.Net.Label>(this.Page);
List<Ext.Net.NumberField> listNum = Ext.Net.Utilities.ControlUtils.FindControls<Ext.Net.NumberField>(this.Page);
for (var i = 0; i < dt.Rows.Count; i++)
{
var labid = "rate" + i.ToString() + "_lab";
var numid = "money" + i.ToString() + "_lab";
listLab.Find(p => p.ID == labid).Text = dt.Rows[i][rate].ToString();
listNum.Find(p => p.ID == numid).TabTip = dt.Rows[i]["b_id"].ToString();
}
再取值:
List<Ext.Net.NumberField> listNum = Ext.Net.Utilities.ControlUtils.FindControls<Ext.Net.NumberField>(this.Page);
List<Ext.Net.Label> listLab = Ext.Net.Utilities.ControlUtils.FindControls<Ext.Net.Label>(this.Page);
List<string> valList = new List<string>();
List<string> noList = new List<string>();
var i = 0;
foreach (Ext.Net.NumberField field in listNum)
{
string v = field.Text.Trim();
if (!string.IsNullOrEmpty(v))
{
if (isCheckMinValue(v))
valList.Add(listLab[i].TabTip + "," + listLab[i].Text.Trim() + "," + v + "," + field.TabTip);
else
noList.Add(listLab[i].TabTip + "," + listLab[i].Text.Trim() + "," + v + field.TabTip);
}
i++;
}
ext:label 如果用火狐查看到的不是HTML控件 而是span 标记 所以不能设置或获取到值的
具体设置: Ext.Net.X.GetCmp("employeeCode").Html = "用户编号: <font class='info_Lable'> I0121140 </font>";