0

我试图通过创建新实例并将新屏幕名称绑定到 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 
4

1 回答 1

0

问题已解决 - 只需将大小写更改为 if 条件。))

于 2012-11-28T10:41:24.673 回答