hygor
Newcomer
I am trying to help a mate with his asp project he is trying to get a counter to update everytime you click the next button, i have set up a simplified version of his webform on my system... he is accessign a database record for the value of the count... that bit of his form works.. so i have left it off my mock up of his form... however when you click the button that updates the counter, the counter seems to reset as if the whole page is loading agian... the whole point of it is so that the page dynamically loads from a db.
here is the shortened code:
if anyone knows a way to get the count to stick then that would be great!
Cheers!
Hygor
here is the shortened code:
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
Dim Counter As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Counter = Counter + 1
Label2.Text = Counter
End Sub
End Class
if anyone knows a way to get the count to stick then that would be great!
Cheers!
Hygor