Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3492100
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:43:03+00:00 2026-05-18T11:43:03+00:00

I have two master pages and a content page. On my local machine this

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T11:43:04+00:00Added an answer on May 18, 2026 at 11:43 am

    Ok, here is the thing, this works sometimes and then when I add another property or recompile it would give me an error. it turns out it is compiler issue. To get around the issue, I had to create a App_Code directory under the root and made a class. When I get the error telling me there is no DivWidth defined, I simple make a code change in the class I created and the site compiles in the proper order. It took opening a case with MS, who was not very helpful, for me to find this workaround. Hope this helps someone else who runs into this strange issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a master page that has two content sections like this (left some
I have two pages that inherit from one master page, First.aspx or second.aspx. Navigation
I have a master page that divides the main content into two areas. There
I have a master page(MyMasterPage.master) with two content place holders. I wanna show another
I would like to have two .css files. One for each master\content page and
I have a MasterPage that has two image buttons , and two content pages,
I have a git repository (at github.com) with two branches: master and gh-pages. I
I have a user control in a master page with two drop down lists.
I have two git repositories: report.git (Master on remote location) cloned.git (Local) I lost
I have a series of nested master pages, like so: site.master: <asp:ContentPlaceHolder ID=SearchFormContent runat=server>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.