Skip to content

Instantly share code, notes, and snippets.

@niwatpumkin
Created September 17, 2014 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niwatpumkin/daa79edab4ffa08d4619 to your computer and use it in GitHub Desktop.
Save niwatpumkin/daa79edab4ffa08d4619 to your computer and use it in GitHub Desktop.
catch error Addsecound on type string not found
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
RadGrid2.DataSource = Data()
RadGrid2.DataBind()
For i As Integer = 0 To RadGrid2.Items.Count - 1
Dim lbltime As Label = RadGrid2.Items.Item(i).FindControl("lblTime")
StartTime = DateTime.Now.AddMinutes(lbltime.Text).ToString("HH:mm:ss")
CurrentTime = StartTime.ToString
lbltime.Text = CurrentTime.ToString("HH:mm:ss").ToString
Session("time") = lbltime.Text
Next
End If
End Sub
Protected Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Try
For i As Integer = 0 To RadGrid2.Items.Count - 1
Dim lbltime As Label = RadGrid2.Items.Item(i).FindControl("lblTime")
' Dim lbltime1 As Label = RadGrid2.Items.Item(i).FindControl("label3")
If Val(lbltime.Text) > 0 Then
CurrentTime = Session("time").AddSeconds(-1).ToString
lbltime.Text = CurrentTime.ToString("HH:mm:ss").ToString
End If
Next
RadGrid2.Rebind()
Catch ex As Exception 'error Addsecound on type String not found
End Try
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment