I have controls defined in my aspx page which I reference in my code-behind, but I'm getting errors everywhere they're referenced in my code-behind. The errors for some of the controls indicate that the controls are not declared.
I have 2 aspx pages in this project and 2 codebehind files. I don't know whether that has anything to do with this. I'm getting these kinds of errors in both codebehind files.
I also have some controls from my first aspx page whose values I pass to the codebehind for my 2nd aspx page by making them public properties in the codebehind for my first aspx page. When I reference them in the codebehind for my 2nd aspx page, by using PreviousPage.controlname, they get an error saying the control is not a member of System.Web.UI.Page.
When I run the project in test mode, everything runs fine.