在数组中有文本框ID需要动态设置值

时间:2018-02-16 12:13:18

标签: c# asp.net

我为此做了什么

var allLiveIDS = Request.Form.AllKeys.Where(key => key.Contains("txt")).ToList();
for (int i = 2; i < allLiveIDS.Count; i++)
        {
          var Textt= this.FindControl(allLiveIDS[i]) as TextBox;
            Textt.Text = "Some Value";
}

但在Textt中获取null,pLease共享如何将值设置为文本框

0 个答案:

没有答案