asp.net,语言。
使用了datagrid,在后台中向datagrid中插入textbox
Dim txtGridTextBox1 As New TextBox()
txtGridTextBox1.ID = "txtA"
dgMain.Items((YY - 1) * 4 + 1).Cells(j - 1).Controls.Add(txtGridTextBox1)然后从数据库中查询数据写入,但是findcontrol不行,
CType(dgMain.Items((YY - 1) * 4 + 2).Cells(j - 1).FindControl("txtA"), TextBox).Text也不行。
使用
CType(dgMain.Items((YY - 1) * 4 + 1).Cells(j - 1).Controls(0), TextBox).Text = NulltoStr(dbReader("行事1"))
好用了。现在进行改动后,点击登陆按钮存入数据库
可是用循环取值的时候,用findcontrol还是找不到,再用
CType(dgMain.Items((YY - 1) * 4 + 1).Cells(j - 1).Controls(0), TextBox).Text
提示index什么错误,于是换成Controls(1)或者Controls(2) 也不行请大家帮助我啊!
谢谢
使用了datagrid,在后台中向datagrid中插入textbox
Dim txtGridTextBox1 As New TextBox()
txtGridTextBox1.ID = "txtA"
dgMain.Items((YY - 1) * 4 + 1).Cells(j - 1).Controls.Add(txtGridTextBox1)然后从数据库中查询数据写入,但是findcontrol不行,
CType(dgMain.Items((YY - 1) * 4 + 2).Cells(j - 1).FindControl("txtA"), TextBox).Text也不行。
使用
CType(dgMain.Items((YY - 1) * 4 + 1).Cells(j - 1).Controls(0), TextBox).Text = NulltoStr(dbReader("行事1"))
好用了。现在进行改动后,点击登陆按钮存入数据库
可是用循环取值的时候,用findcontrol还是找不到,再用
CType(dgMain.Items((YY - 1) * 4 + 1).Cells(j - 1).Controls(0), TextBox).Text
提示index什么错误,于是换成Controls(1)或者Controls(2) 也不行请大家帮助我啊!
谢谢
VB C#差不多
进行改动后,点击登陆按钮时候有没有动态生成控件阿