Count every Buton clicks
<p>the task is to count the number of clicks in a webform.</p>

<p>here is the code.</p>

<pre><code>public partial class _default : System.Web.UI.Page
    {
        int count = 1;
        private void Page_Load(object sender, System.EventArgs e)
        {
            Button btn = new Button();
            btn.Text = "Click Me";
            btn.Click  += btn_Click;
            Label lbl = new Label();
            form1.Controls.Add(btn);
            form1.Controls.Add(lbl);


        }

        protected void btn_Click(object sender, EventArgs e)
        {
            count++;
            //Label1.Text = count.ToString();

        }
    }
</code></pre>

<p>the problem is that <strong>lbl</strong> is not recognised inside <strong>btn_Click()</strong> ... i cant figure it out... can any one suggest?</p>
