After putting a textbox on my page when I compile it I get the above error:
\'txtName\' is not declared. It may be inaccessible due to its protection level.
I had a similar problem after adding controls to a web sete originally written in VS 2008 .Net 3.5 to VS 2010 .Net 4 After adding controls, I got the same error. When I looked at the .designer.vb file for the page, the added controls were not there. The problem was resolved by just adding the controls to the bottom of the file like: Protected WithEvents lblApprove As Global.System.Web.UI.WebControls.Label