动态显示AjaxControlToolkit.Twitter?

时间:2012-09-05 13:35:19

标签: vb.net twitter ajaxcontroltoolkit

我正在尝试通过创建新实例并将新屏幕名称绑定到Twitter并将此控件放置到Panel来动态显示AjaxControlToolkit.Twitter。但它不起作用。有什么建议吗?

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim RandomNumber As New Random()
        Dim rn As Short
        rn = RandomNumber.Next(1, 6)
        Select Case rn
            Case rn = 1
                Dim tw As New AjaxControlToolkit.Twitter()
                tw.ScreenName = "aspnet"
                tw.DataBind()
                pnlTw.Controls.Add(tw)
            Case rn = 2
                Dim tw As New AjaxControlToolkit.Twitter
                tw.ScreenName = "smashingmag"
                tw.DataBind()
                pnlTw.Controls.Add(tw)
            Case rn = 3
                Dim tw As New AjaxControlToolkit.Twitter
                tw.ScreenName = "LessThanDot"
                tw.DataBind()
                pnlTw.Controls.Add(tw)
            Case rn = 4
                Dim tw As New AjaxControlToolkit.Twitter
                tw.ScreenName = "scottgu"
                tw.DataBind()
                pnlTw.Controls.Add(tw)
            Case rn = 5
                Dim tw As New AjaxControlToolkit.Twitter
                tw.ScreenName = "Encosia"
                tw.DataBind()
                pnlTw.Controls.Add(tw)
            Case rn = 6
                Dim tw As New AjaxControlToolkit.Twitter
                tw.ScreenName = "domvtae"
                tw.DataBind()
                pnlTw.Controls.Add(tw)
        End Select
    End Sub 

1 个答案:

答案 0 :(得分:0)

问题已经解决 - 只是将案例改为if条件。 ))