Inside the class of my webform, I define a new variable, an integer, like this:
Then I have a button that just assigns a value to Test.Code:Public Class WebForm1 Inherits System.Web.UI.Page Protected test As integer
However, when the users clicks a submit button (an empty one) and the page refreshes, test returns to 0. Why? Is there any way I can have this variable persist!?Code:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click test = 5 End Sub


Reply With Quote