나는이 SQL 테이블에서 코드 숨김에서 만든 양식이 있습니다 StringBuilder를 사용하여 컨트롤을 조인하는 방법?
Dim holder As PlaceHolder = CType(FV.FindControl("plControl"), PlaceHolder)
Dim html As New StringBuilder()
html.Append("<table>")
For Each Row As DataRow In ds.Tables(0).Rows
html.Append("<tr style='border: 1px solid black; height:30px;'>")
html.Append("<td style='padding-right:40px; width:400px; text-align:right; background-color:lightgray;border: 1px solid black;'><b>")
html.Append(Row(columnName:="Name"))
html.Append("</b></td>")
html.Append("<td style='width:300px; text-align:center; background-color:lightgray;border: 1px solid black;'>")
html.Append("</td>")
html.Append("<td style='width:300px; text-align:center; background-color:lightgray;border: 1px solid black;'>")
html.Append("</td>")
html.Append("</tr>")
Next
html.Append("</table>")
holder.Controls.Add(New Literal() With { _
.Text = html.ToString() _
})
지금이 테이블에 내가 추가 할 및 컨트롤을하지만 모든 컨트롤은 HTML 텍스트로 인식됩니다 StringBuilder에 추가.
Dim btn As New Button
btn.Text = "Click me.."
AddHandler btn.Click, AddressOf MyButton_Click
MyPlaceHolder.Controls.Add(btn)
을하지만,이 컨트롤은 내 테이블의 상단에 추가됩니다
나는 루프에서 이것을 사용했다. 나는이 테이블 컨트롤에 추가 할 방법이 있는지 알고 싶습니다.