I just had similar project. The trick is each time the page is reloaded it has no memory of the class variables and user values. Every time the server gets a request, the program starts again from scratch, that is a whole new instance of your Web form class.
Buttons send data back automatically to the server by default. Whereas controls which are not buttons, by default become static HTML. You need to set these controls to AutoPostBack is true.
Then you can store variables in HiddenFields such as ID number or non-sensitive data so you can look up the previous state of the web page.
snippets from my project:
if (!IsPostBack){
this.HiddenFieldStatus.Value = "no";
}
else{
string status = this.HiddenFieldStatus.Value;
this.user = this.TextBoxUser.Text;
this.password = this.TextBoxPW.Text;
}