after weeks of having this issue I finally decided to ask for a solution to the following problem:
In the .aspx page you can set
<%@ MasterType
I had this same problem when I added <%@ MasterType VirtualPath="~/TestMaster.Master" %>
to my aspx page in SOURCE view. For some reason, the page never created correctly and kept giving me invalid namespace errors until I actually changed to DESIGN view and resized a control and finally the error went away. Somewhere it was using some cached data (even a Build/Clean Solution didn't clear it out) and until the designer recreates the page, it generates that error.