newbie question

Posted on 16th Feb 2014 by admin

Hi out thereIm totaly new in this forum and to .net and vb so here is a totaly newbie question.I want to make a couter display how many times ive clicket a buttonWhy does my code alwas start over at 0 so "Counter" newer gets higher then 1?
view plaincopy to clipboardprint?Partial Class _Default Inherits System.Web.UI.Page Dim Counter As Integer Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Counter += Counter Label1.Text = Counter End Sub End Class

Other forums