为什么'index'总是返回值0,尽管股票代码正在运行并且有一条语句'index = index + 1'?
'Dim index as integer = 0
'EDIT
Dim GridRowIndex as integer
Protected Sub TickerAnnouncement_Tick(sender As Object, e As System.EventArgs) Handles TickerAnnouncement.Tick
lblAnnouncementFooter.Text = GridView1.Rows(index).Cells(0).Text
'index = index + 1
If GridRowIndex> GridView1.Rows.Count Then GridRowIndex = 0
End Sub
我已启用刻度,但索引仍返回 0 值。
- -添加 - -
我有一个名为“IndexValue”的属性:
Public Property IndexValue() As Integer
Get
Dim s As Integer = DirectCast(ViewState("GridRowIndex"), Integer)
Return If(ViewState("GridRowIndex") Is Nothing, 0, CInt(ViewState("GridRowIndex")) + 1)
End Get
Set(value As Integer)
ViewState("GridRowIndex") = value
End Set
End Property