 <p>Do one thing , create a new visual studio 2010 solution and <code>import</code> the files . Everything will work fine .</p> <p>This error frequently occurs if you declare a variable in a loop or a try or if block and then attempt to access it from an enclosing code block or a separate code block. </p> <p>Better delete the designer file. You can then right-click on the page, in the solution explorer, and there is an option like <strong><code>Convert to Web Application</code></strong>, which will regenerate your designer file.</p>