C#学习教程:如何解决'System.Web.UI.MasterPage'doesnotcontainadefinition的错误两个母版页和一个内容页。在我的本地机器上,这段代码工作正常,但是一旦我上传到服务器,我就会收到以下错误:编译错误描述:在编译服务于此请求所需的资源期间发生错误。请查看下面的具体错误详细信息并相应地修改源代码。编译器错误消息:CS1061:“System.Web.UI.MasterPage”不包含“DivWidth”的定义,并且找不到接受“System.Web.UI.MasterPage”类型的第一个参数的扩展方法“DivWidth”(您是否错过了using指令或程序集引用?)源错误:第84行:第85行:第86行:this.Master.Master.DivWidth=955;第87行:SimpleElementCollectionrestrictedIds=newSimpleElementCollection();第88行:restrictedIds.Add(newSimpleElement(priceModifierPriceTypeId));源文件:c:InetpubtestsiteshopDefault.aspx.csLine:86BasicHomepagecocde:publicpartialclassglobal:System.Web.UI.MasterPage{publicintDivWidth{get;放;}protectedvoidPage_Load(objectsender,EventArgse){SetBodyClass();如果(DivWidth<1){DivWidth=768;}}基本母版页aspx:页面标题
