I have two master pages and a content page. On my local machine this code works, but once I uploaded to the server I got the following error:
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1061: 'System.Web.UI.MasterPage' does not contain a definition for 'DivWidth' and no extension method 'DivWidth' accepting a first argument of type 'System.Web.UI.MasterPage' could be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 84:
Line 85:
Line 86: this.Master.Master.DivWidth = 955;
Line 87: SimpleElementCollection restrictedIds = new SimpleElementCollection();
Line 88: restrictedIds.Add(new SimpleElement(priceModifierPriceTypeId));
Source File: c:\Inetpub\testsite\shop\Default.aspx.cs Line: 86
Base Masterpage cocde:
public partial class global : System.Web.UI.MasterPage
{
public int DivWidth { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
SetBodyClass();
if (DivWidth < 1)
{
DivWidth = 768;
}
}
Base Masterpage aspx:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="global.master.cs" Inherits="global" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
<head id="Head1" runat="server" dir="ltr" lang="en-us" profile="http://dublincore.org/documents/dcq-html/">
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>page title</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-type" content="en-US" />
<meta http-equiv="content-language" content="en-us" />
<link rel="Bookmark" href="#content" title="Page Content" type="text/html" />
<link rel="Bookmark" href="#primary-navigation" title="Site Navigation" type="text/html" />
<link href="css/screen/global.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/print/print.css" rel="stylesheet" type="text/css" media="print" />
<script src="<%=ResolveUrl("~/javascript/jquery-1.2.6.min.js")%>" type="text/javascript"></script>
<script src="<%=ResolveUrl("~/javascript/jquery.clearonfocus.js")%>" type="text/javascript"></script>
<script src="<%=ResolveUrl("~/javascript/modalControl.js")%>" type="text/javascript"></script>
<asp:ContentPlaceHolder ID="headPlaceholder" runat="server" />
<!--[if IE]><link href="css/screen/ie/ie.css" rel="stylesheet" type="text/css" media="screen" /><![endif]-->
<!--[if IE 6]><link href="css/screen/ie/ie-6.css" rel="stylesheet" type="text/css" media="screen" /><![endif]-->
]
</head>
<body id="Body" runat="server">
<div id="main">
<div id="main-inner">
<div id="content" style="width:<%=DivWidth%>px;"><div id="content-top"></div><div class="content-inner"><asp:ContentPlaceHolder ID="contentPlaceHolder" runat="server" /><asp:ContentPlaceHolder ID="BelowLeftRightMainContent" runat="server" /></div> </div>
</body>
</html>
Second Master Page:
<%@ Master Language="C#" MasterPageFile="~/global.master" AutoEventWireup="false" CodeFile="shopFalcon.master.cs" Inherits="shopFalcon" %>
<%@ Register TagPrefix="FALCON" TagName="FeatureProducts" Src="~/FalconShopRightHand.ascx" %>
<%@ Register TagPrefix="FALCON" TagName="ProductSearch" Src="~/FalconProductSearch.ascx" %>
<%@ Register TagPrefix="FALCON" TagName="AbuseText" Src="~/FalconAbuseLinkDisplay.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="headPlaceholder" Runat="Server">
</asp:Content>
nothing in the code behind cept empty code behind
My content page:
<%@ Page Language="C#" MasterPageFile="~/shop.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="shopFalcon_Default" Title="Shop Homepage" %>
<%@ MasterType VirtualPath="~/shop.master"%>
<asp:Content ID="Content7" ContentPlaceHolderID="leftColPlaceHolder" Runat="Server">
<asp:Image ID="Image1" runat="server" ImageAlign="Right" ImageUrl="~/images/Free+Shipping+01.jpg" CssClass="img"/>
<h1>Shop Anytime, anywhere. </h1>
<div id="shopByBrandDiv">
</asp:Content>
My code behind:
protected void Page_Load(object sender, EventArgs e)
{
this.Master.Master.DivWidth = 955;
}
Again this works in Visual Studio using the built in web server but delpoying to the production server running IIS6 I get that error stated above.
Any ideas?