The code below shows the event when a button click is fire
Protected Sub btnFinish_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnFinish.Click
For i As Integer = 0 To Gridview1.Rows.Count - 1 Step i + 1
Dim TextBox1 As TextBox = DirectCast(Me.Gridview1.Rows(i).FindControl("txtAnswer"), TextBox)
If TextBox1.Text = String.Empty Then
'do something
ElseIf TexBox1 <> String.Empty Then
'do something else
End If
Next
End Sub
The problem here is that the only condition being executed is in the If-statement even if it should execute the ElseIf-statement. Can someone explain why and how can I solve this problem? [EDITED]