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 have had that problem before. Not sure what caused it. But by deleting the offending textbox and adding it again it fixed it.