For loop inside asp:ImageButton Click event (VB.net)
<%@ Page Language="VB" %>
<script runat="server">
Sub ImageButton1_Click(sender As Object, e As ImageClickEventArgs)
Dim Counter as Integer
For Counter = 1 To 100 ' Start looping 100 times
Label1.Text &= Counter.ToString() & ": I Love You! " & "<BR />"
Next
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<p>
<asp:ImageButton id="ImageButton1" onclick="ImageButton1_Click" runat="server" ImageUrl="http://www.java2s.com/style/logo.png"></asp:ImageButton>
</p>
<p>
<asp:Label id="Label1" runat="server"></asp:Label>
</p>
</form>
</body>
</html>
Related examples in the same category