Simple question on Viewstate

  • Thread starter Thread starter Danny
  • Start date Start date
D

Danny

Hi,

I have a very simple asp.net application with a webform and an integer data
member. I've placed a button on this form which increments the integer data
member by 1 each time it is clicked and displays it with Response.Write.
The data member's value is not saved in each button click, and the value
always stays the same.
I have viewstate enabled for the page.
How can I change this behavour ?

Thanks,

Danny
 
Hi,

if that member is simply a class member you will not have
it's value saved between posts. Consider keeping it in
ViewState

Thanks,
Rovshan
 
Ok, then how do you suggest this should be done?
What if it's an object such as an enumerator I want to keep? And one last
question - in case of a mobile form, I don't have ViewState. Are there any
alternatives?
 
Back
Top