動態產生控制項(Radiobutton)
Public Sub Radiobutton(ByVal Items As Integer)
Dim RadioBut As New RadioButtonList
RadioBut.ID = "RB" & Items
RadioBut.Items.Add("選擇題")
RadioBut.Items.Add("問答題")
RadioBut.RepeatDirection = RepeatDirection.Horizontal
PlaceHolder1.Controls.Add(New LiteralControl(" <td width=30%>"))
PlaceHolder1.Controls.Add(RadioBut)
PlaceHolder1.Controls.Add(New LiteralControl(" </td>"))
PlaceHolder1.Controls.Add(New LiteralControl(" <tr>"))
PlaceHolder1.Controls.Add(New LiteralControl(" </table>"))
End Sub
動態產生控制項抓取
RadioBut = PlaceHolder1.FindControl(Ite)
標籤: VB.NET