Quote:
do I need to store my counter in a session
Yes. But
ViewState
makes more sense here as this value will only be used on this page. So, better save in
ViewState
and read from there.
If you don't save it anywhere, each time it goes through your code, it again assigns 0 to the counter