Partial Class Default2 Inherits System.Web.UI.Page Function increment_counter() As Integer Static iCounter As Integer = 0 iCounter = iCounter + 1 Return iCounter End Function Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Label1.Text = increment_counter() End Sub End ClassI'm sure there's something fundemental I'm missing about the difference between Web and desktop computing....almost certainly something to do with stateless computing......but if somebody could post some sample code, I can use that as a jumping off point.
< %@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %> < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> < html xmlns="http://www.w3.org/1999/xhtml"> < head runat="server"> < title>< /title> < /head> < body> < form id="form1" runat="server"> < div> < /div> < asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> < asp:Button ID="Button1" runat="server" Text="Button" /> < /form> < /body> < /html>Thanks to all.........Rich