Consider below code.
public partial class _Default : System.Web.UI.Page
{
private static string count = "0";
protected void Page_Load(object sender, EventArgs e)
{
lock (count)
{
int tempCount;
if (int.TryParse(count, out tempCount))
{
&nb ...
Go to the complete details ...