How to fix namespace problem with autogenerated Master property if MasterType is set

后端 未结 5 1116
心在旅途
心在旅途 2020-12-18 06:06

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          


        
5条回答
  •  攒了一身酷
    2020-12-18 06:53

    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.

提交回复
热议问题