i just want to change value of the public variable that i declared at the main class. how to change their value when a button clicked?
I suppose you are refering to asp.net so you should add a click handler to the button and in the function (button click handler) you set the value of the variable as you wish.