How can I change the value of a variable when executing a button without using a Client Script ?

How can I change the value of a variable when executing a button without using a Client Script ?

Is it possible to do this?