定义Label Label1,如果Label1是变量,怎么定义? 定义Label Label1,如果Label1是变量,怎么定义? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 楼上的 findcontrol,然后赋值 什么意义 ? 请给出example!!! Control myControl1 = FindControl("Label1");if (myControl1 != null){ ((System.Web.UI.WebControls.Label)(myControl1)).Text = "asdfsdfsdf";} 我这个label1是字符串变量,也许存的是"label1"也许是"label2",总之我定义很多控件,每次给label1赋予不同的值。 Control myControl;for (int i = 0; i < 5; i++){ myControl1 = FindControl("Label" + (i + 1).ToString()); if (myControl != null) { ((System.Web.UI.WebControls.Button)(myControl)).Text = "XXX"; }} Control myControl;for (int i = 0; i < 5; i++){ myControl = FindControl("Label" + (i + 1).ToString()); if (myControl != null) { ((System.Web.UI.WebControls.Button)(myControl)).Text = "XXX"; }} 那就在PAGELOAD中动态加载了。 如何整软件试用? c# 实现命令接口 函数返回值类型为T 如何返回null? gridview动态生成列的问题 关于网络的问题 winform的datagrid问题 问一个定时触发的问题 关于自定义控件的属性问题,请进 求个思路,批量文本转换器是怎么写出来的? 为什么我将一个'类'类型项目活动配置改成了Release,编译后还是会产生.pdb? 简单问题,急 使用DataGrid时报错:无法识别的配置节 add?
请给出example!!!
if (myControl1 != null)
{
((System.Web.UI.WebControls.Label)(myControl1)).Text = "asdfsdfsdf";
}
{
myControl1 = FindControl("Label" + (i + 1).ToString());
if (myControl != null)
{
((System.Web.UI.WebControls.Button)(myControl)).Text = "XXX";
}
}
{
myControl = FindControl("Label" + (i + 1).ToString());
if (myControl != null)
{
((System.Web.UI.WebControls.Button)(myControl)).Text = "XXX";
}
}