2012年11月8日 星期四

動態產生控制項(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)

標籤:

0 個意見:

張貼留言

訂閱 張貼留言 [Atom]

<< 首頁