I have a static int that keeps an record of how many user control has been added to page.
static int mycount = 1; //Default value
When I add more controls to the page the counter gets +1, that’s working fine
static int mycount = 2; //Add second control
But if I open another instance of the page in different browser the counter still has mycount=2
The static int sould have 1 as default if you open a new browser session.
Do I need to work with sessions or what?
//UPDATE
I used Sessions after I found an answer here on SO
How to access session variables from any class in ASP.NET?
Very good explanation on the session handling
Absolutely I would recommend using something that not static because static is saved in the memory and may stay there for a while, in other way session variable are stored in the session that is usually just depends on the specific user therefore all session variable are unique for the user while static variable are more difficult to make unique.
http://msdn.microsoft.com/en-us/library/ms178581.aspx
Or based on your case it even better to use viewstate
http://msdn.microsoft.com/en-us/library/4yfdwycw%28v=vs.71%29.aspx