1

I've just taken over a C#/.NET project last touched a few years ago with with the task of updating it and including more functionality. I have no experience with the platform and so am struggling to fix this error.

The system is currently live (and works), but I've gotten a copy running on my machine and I get the following error which I cannot seem to figure out to get it up and running:

Compiler Error Message: CS0120: An object reference is required for the non-static field, method, or property '<ProjectName>.<PageName>.System'

Source Error:


Line 195:        
Line 196:        private static System.Reflection.MethodInfo @__PageInspector_LoadHelper(string helperName) {
Line 197:            System.Type helperClass = System.Type.GetType("Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceHelpers, Microsoft" +
Line 198:                    ".VisualStudio.Web.PageInspector.Tracing, Version=2.0.0.0, Culture=neutral, Publi" +
Line 199:                    "cKeyToken=b03f5f7f11d50a3a", false, false);

I've established from other questions that this error is normally caused when using non-static fields and methods incorrectly like this or this, but in my case it seems to be coming from a temporary file, which I have no control over?

UPDATE: The Admin.aspx file is below:

<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="false"
    EnableEventValidation="false" CodeBehind="Admin.aspx.cs" Inherits="CallLog.Admin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="AdminContent1" runat="server">
    <div id="System" class="SectionTitle" runat="server">
        <table cellpadding="1px" cellspacing="1px">
            <tr>
                <td class="SectionTitleTd">
                    <i>SYSTEM</i>
                </td>
            </tr>
        </table>
    </div>
        <table>
        <tr>
            <td>
                <asp:TextBox ID="txtAddAppSystem" runat="server" Width="200px"></asp:TextBox>
                <asp:Button ID="btnAddAppSystem" CssClass="Save" runat="server" Text="Add New System"
                    OnClick="btnAddAppSystem_Click" ValidationGroup="appsystem" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ValidationGroup="appsystem" ControlToValidate="txtAddAppSystem" ErrorMessage="Please Add System" CssClass="Warning"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="gvAppSystem" runat="server" AutoGenerateColumns="False" AlternatingRowStyle-BackColor="White"
                    BorderColor="Gray" DataKeyNames="AppSystemId" OnRowCancelingEdit="gvAppSystem_RowCancelingEdit"
                    OnRowEditing="gvAppSystem_RowEditing" OnRowUpdating="gvAppSystem_RowUpdating">
                    <AlternatingRowStyle BackColor="White"></AlternatingRowStyle>
                    <Columns>
                        <asp:CommandField ButtonType="Button" ShowEditButton="true" ShowCancelButton="true"
                            ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField DataField="appSystemId" HeaderText="ID" ReadOnly="true" Visible="false" />
                        <asp:TemplateField HeaderText="System" ItemStyle-Width="150px">
                            <ItemTemplate>
                                &nbsp &nbsp
                                <%# Eval("appSystemDesc")%>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox runat="server" ID="txtAppSystem" Text='' value='<%# Eval ("appSystemDesc") %>' />
                            </EditItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="AdminContent2" runat="server">
    <div id="Div1" class="SectionTitle" runat="server">
        <table cellpadding="1px" cellspacing="1px">
            <tr>
                <td class="SectionTitleTd">
                    <i>STATUS</i>
                </td>
            </tr>
        </table>
    </div>
    <table>
        <tr>
            <td>
                <asp:TextBox ID="txtAddStatus" runat="server" Width="200px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ValidationGroup="status" runat="server" ControlToValidate="txtAddStatus" ErrorMessage="Please Add Status" CssClass="Warning"></asp:RequiredFieldValidator>
                <asp:Button ID="btnAddStatus" CssClass="Save" runat="server" ValidationGroup="status" Text="Add New Status"
                    OnClick="btnAddStatus_Click" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="gvStatus" runat="server" AutoGenerateColumns="False" AlternatingRowStyle-BackColor="White"
                    BorderColor="Gray" DataKeyNames="statusId" OnRowCancelingEdit="gvStatus_RowCancelingEdit"
                    OnRowEditing="gvStatus_RowEditing" OnRowUpdating="gvStatus_RowUpdating">
                    <AlternatingRowStyle BackColor="White"></AlternatingRowStyle>
                    <Columns>
                        <asp:CommandField ButtonType="Button" ShowEditButton="true" ShowCancelButton="true"
                            ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField DataField="statusId" HeaderText="ID" ReadOnly="true" Visible="false" />
                        <asp:TemplateField HeaderText="Status" ItemStyle-Width="150px">
                            <ItemTemplate>
                                &nbsp &nbsp
                                <%# Eval("statusDesc") %>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox runat="server" ID="txtStatus" Text='' value='<%# Eval ("statusDesc") %>' />
                            </EditItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="AdminContent3" runat="server">
    <div id="Jurisdiction" class="SectionTitle" runat="server">
        <table cellpadding="1px" cellspacing="1px">
            <tr>
                <td class="SectionTitleTd">
                    <i>JURISDICTION</i>
                </td>
            </tr>
        </table>
    </div>
    <div>
        <table>
            <tr>
                <td>
                    <asp:TextBox ID="txtAddJurisdiction" runat="server" Width="200px"></asp:TextBox>
                    <asp:Button ID="btnAddJurisdiction" CssClass="Save" runat="server" ValidationGroup="juridiction" Text="Add New Jurisdiction"
                        OnClick="btnAddJurisdiction_Click" />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ValidationGroup="juridiction" ControlToValidate="txtAddJurisdiction" ErrorMessage="Please Add Juridiction" CssClass="Warning"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="gvJurisdiction" runat="server" AutoGenerateColumns="False" AlternatingRowStyle-BackColor="White"
                        BorderColor="Gray" DataKeyNames="jurisdictionId" OnRowCancelingEdit="gvJurisdiction_RowCancelingEdit"
                        OnRowEditing="gvJurisdiction_RowEditing" OnRowUpdating="gvJurisdiction_RowUpdating">
                        <AlternatingRowStyle BackColor="White"></AlternatingRowStyle>
                        <Columns>
                            <asp:CommandField ButtonType="Button" ShowEditButton="true" ShowCancelButton="true"
                                ItemStyle-HorizontalAlign="Center" />
                            <asp:BoundField DataField="jurisdictionId" HeaderText="ID" ReadOnly="true" Visible="false" />
                            <asp:TemplateField HeaderText="Jurisdiction" ItemStyle-Width="150px">
                                <ItemTemplate>
                                    &nbsp &nbsp
                                    <%# Eval("jurisdictionDesc") %>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox runat="server" ID="txtJurisdiction" Text='' value='<%# Eval ("jurisdictionDesc") %>' />
                                </EditItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="AdminContent4" runat="server">
    <div id="Impact" class="SectionTitle" runat="server">
        <table cellpadding="1px" cellspacing="1px">
            <tr>
                <td class="SectionTitleTd">
                    <i>IMPACT</i>
                </td>
            </tr>
        </table>
    </div>
    <div>
        <table>
            <tr>
                <td>
                    <asp:TextBox ID="txtImpact" runat="server" Width="200px"></asp:TextBox>
                    <asp:Button ID="btnImpact" CssClass="Save" runat="server" Text="Add New Impact" ValidationGroup="impact" OnClick="btnAddImpact_Click" />
               <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtImpact" ValidationGroup="impact" ErrorMessage="Please Add Impact" CssClass="Warning"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="gvImpact" runat="server" AutoGenerateColumns="False" AlternatingRowStyle-BackColor="White"
                        BorderColor="Gray" DataKeyNames="impactId" OnRowCancelingEdit="gvImpact_RowCancelingEdit"
                        OnRowEditing="gvImpact_RowEditing" OnRowUpdating="gvImpact_RowUpdating">
                        <AlternatingRowStyle BackColor="White"></AlternatingRowStyle>
                        <Columns>
                            <asp:CommandField ButtonType="Button" ShowEditButton="true" ShowCancelButton="true"
                                ItemStyle-HorizontalAlign="Center" />
                            <asp:BoundField DataField="impactId" HeaderText="ID" ReadOnly="true" Visible="false" />
                            <asp:TemplateField HeaderText="Impact" ItemStyle-Width="150px">
                                <ItemTemplate>
                                    &nbsp &nbsp
                                    <%# Eval("impactDesc") %>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox runat="server" ID="txtImpact" Text='' value='<%# Eval ("impactDesc") %>' />
                                </EditItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="AdminContent5" runat="server">
    <div id="Period" class="SectionTitle" runat="server">
        <table cellpadding="1px" cellspacing="1px">
            <tr>
                <td class="SectionTitleTd">
                    <i>PERIOD</i>
                </td>
            </tr>
        </table>
    </div>
        <div>
        <table>
            <tr>
                <td>
                    <asp:TextBox ID="txtAddPeriod" runat="server" Width="200px"></asp:TextBox>
                    <asp:Button ID="btnAddPeriod" CssClass="Save" runat="server" ValidationGroup="period" Text="Add New Period"
                        OnClick="btnAddPeriod_Click" />
               <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ValidationGroup="period" ControlToValidate="txtAddPeriod" ErrorMessage="Please Add Period" CssClass="Warning"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="gvPeriod" runat="server" AutoGenerateColumns="False" AlternatingRowStyle-BackColor="White"
                        BorderColor="Gray" DataKeyNames="periodId" OnRowCancelingEdit="gvPeriod_RowCancelingEdit"
                        OnRowEditing="gvPeriod_RowEditing" OnRowUpdating="gvPeriod_RowUpdating">
                        <AlternatingRowStyle BackColor="White"></AlternatingRowStyle>
                        <Columns>
                            <asp:CommandField ButtonType="Button" ShowEditButton="true" ShowCancelButton="true"
                                ItemStyle-HorizontalAlign="Center" />
                            <asp:BoundField DataField="periodId" HeaderText="ID" ReadOnly="true" Visible="false" />
                            <asp:TemplateField HeaderText="Period" ItemStyle-Width="150px">
                                <ItemTemplate>
                                    &nbsp &nbsp
                                    <%# Eval("periodDesc") %>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox runat="server" ID="txtPeriod" Text='' value='<%# Eval ("periodDesc") %>' />
                                </EditItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="AdminContent6" runat="server">
    <div id="Issue" class="SectionTitle" runat="server">
        <table cellpadding="1px" cellspacing="1px">
            <tr>
                <td class="SectionTitleTd">
                    <i>ISSUE</i>
                </td>
            </tr>
        </table>
    </div>
        <div>
        <table>
            <tr>
                <td>
                    <asp:TextBox ID="txtAddIssue" runat="server" Width="200px"></asp:TextBox>
                    <asp:Button ID="btnAddIssue" CssClass="Save" runat="server" ValidationGroup="issue" Text="Add New Issue"
                        OnClick="btnAddIssue_Click" />
               <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ValidationGroup="issue" ControlToValidate="txtAddIssue" ErrorMessage="Please Add Issue" CssClass="Warning"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="gvIssue" runat="server" AutoGenerateColumns="False" AlternatingRowStyle-BackColor="White"
                        BorderColor="Gray" DataKeyNames="issueId" OnRowCancelingEdit="gvIssue_RowCancelingEdit"
                        OnRowEditing="gvIssue_RowEditing" OnRowUpdating="gvIssue_RowUpdating">
                        <AlternatingRowStyle BackColor="White"></AlternatingRowStyle>
                        <Columns>
                            <asp:CommandField ButtonType="Button" ShowEditButton="true" ShowCancelButton="true"
                                ItemStyle-HorizontalAlign="Center" />
                            <asp:BoundField DataField="issueId" HeaderText="ID" ReadOnly="true" Visible="false" />
                            <asp:TemplateField HeaderText="Issue" ItemStyle-Width="150px">
                                <ItemTemplate>
                                    &nbsp &nbsp
                                    <%# Eval("issueDesc")%>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox runat="server" ID="txtIssue" Text='' value='<%# Eval ("issueDesc") %>' />
                                </EditItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div> 
</asp:Content>

UPDATE 2: The Admin.aspx.cs file below:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Midtier.DAL;

namespace CallLog
{
    public partial class Admin : System.Web.UI.Page
    {
        AdminDisplay ad = new AdminDisplay();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                listJurisdictions();
                listImpact();
                listStatus();
                listPeriod();
                listAppSystem();
                listIssue();
            }
        }

        #region AppSystem

        public void listAppSystem()
        {
            gvAppSystem.DataSource = ad.getAppSystem();
            gvAppSystem.DataBind();
        }

        protected void gvAppSystem_RowEditing(object sender, GridViewEditEventArgs e)
        {
            btnAddAppSystem.Enabled = false;
            gvAppSystem.EditIndex = e.NewEditIndex;
            listAppSystem();
        }

        protected void gvAppSystem_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
        {
            e.Cancel = true;
            gvAppSystem.EditIndex = -1;
            listAppSystem();
        }

        protected void gvAppSystem_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            GridViewRow row = gvAppSystem.Rows[e.RowIndex];

            TextBox txtAppSystemDesc = (TextBox)row.FindControl("txtAppSystem");

            int appSystemID = Int32.Parse(gvAppSystem.DataKeys[e.RowIndex].Value.ToString());
            string appSystemDesc = txtAppSystemDesc.Text;

            AdminUpdates au = new AdminUpdates();
            au.AddEditAppSystem(appSystemID, appSystemDesc);

            gvAppSystem.EditIndex = -1;
            listAppSystem();
            btnAddAppSystem.Enabled = true;
        }

        protected void btnAddAppSystem_Click(object sender, EventArgs e)
        {
            AdminUpdates au = new AdminUpdates();
            au.AddEditAppSystem(-1, txtAddAppSystem.Text);
            listAppSystem();
            txtAddStatus.Text = "";
        }

        #endregion

        #region Status

        public void listStatus()
        {
            gvStatus.DataSource = ad.getStatus();
            gvStatus.DataBind();
        }

        protected void gvStatus_RowEditing(object sender, GridViewEditEventArgs e)
        {
            btnAddStatus.Enabled = false;
            gvStatus.EditIndex = e.NewEditIndex;
            listStatus();
        }

        protected void gvStatus_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
        {
            e.Cancel = true;
            gvStatus.EditIndex = -1;
            listStatus();
        }

        protected void gvStatus_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            GridViewRow row = gvStatus.Rows[e.RowIndex];

            TextBox txtStatusDesc = (TextBox)row.FindControl("txtStatus");

            int statusID = Int32.Parse(gvStatus.DataKeys[e.RowIndex].Value.ToString());
            string statusDesc = txtStatusDesc.Text;

            AdminUpdates au = new AdminUpdates();
            au.AddEditStatus(statusID, statusDesc);

            gvStatus.EditIndex = -1;
            listStatus();
            btnAddStatus.Enabled = true;
        }

        protected void btnAddStatus_Click(object sender, EventArgs e)
        {
            AdminUpdates au = new AdminUpdates();
            au.AddEditStatus(-1, txtAddStatus.Text);
            listStatus();
            txtAddStatus.Text = "";
        }

        #endregion

        #region Jurisdiction

        private void listJurisdictions()
        {
            gvJurisdiction.DataSource = ad.getJurisdiction();
            gvJurisdiction.DataBind();
        }

        protected void gvJurisdiction_RowEditing(object sender, GridViewEditEventArgs e)
        {
            btnAddJurisdiction.Enabled = false;
            gvJurisdiction.EditIndex = e.NewEditIndex;
            listJurisdictions();
        }

        protected void gvJurisdiction_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
        {
            e.Cancel = true;
            gvJurisdiction.EditIndex = -1;
            listJurisdictions();
        }

        protected void gvJurisdiction_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            GridViewRow row = gvJurisdiction.Rows[e.RowIndex];

            TextBox txtJurisdictionDesc = (TextBox)row.FindControl("txtJurisdiction");

            int jurisdictionID = Int32.Parse(gvJurisdiction.DataKeys[e.RowIndex].Value.ToString());
            string jurisdictionDesc = txtJurisdictionDesc.Text;

            AdminUpdates au = new AdminUpdates();
            au.AddEditJurisdiction(jurisdictionID, jurisdictionDesc);

            gvJurisdiction.EditIndex = -1;
            listJurisdictions();
            btnAddJurisdiction.Enabled = true;
        }

        protected void btnAddJurisdiction_Click(object sender, EventArgs e)
        {
            AdminUpdates au = new AdminUpdates();
            au.AddEditJurisdiction(-1, txtAddJurisdiction.Text);
            listJurisdictions();
            txtAddJurisdiction.Text = "";
        }
        #endregion

        #region Impact

        private void listImpact()
        {
            gvImpact.DataSource = ad.getImpact();
            gvImpact.DataBind();
        }

        protected void gvImpact_RowEditing(object sender, GridViewEditEventArgs e)
        {
            btnImpact.Enabled = false;
            gvImpact.EditIndex = e.NewEditIndex;
            listImpact();
        }

        protected void gvImpact_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
        {
            e.Cancel = true;
            gvImpact.EditIndex = -1;
            listImpact();
        }

        protected void gvImpact_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            GridViewRow row = gvImpact.Rows[e.RowIndex];

            TextBox txtImpactDesc = (TextBox)row.FindControl("txtImpact");

            int impactID = Int32.Parse(gvImpact.DataKeys[e.RowIndex].Value.ToString());
            string impactDesc = txtImpactDesc.Text;

            AdminUpdates au = new AdminUpdates();
            au.AddEditImpact(impactID, impactDesc);

            gvImpact.EditIndex = -1;
            listImpact();
            btnImpact.Enabled = true;
        }

        protected void btnAddImpact_Click(object sender, EventArgs e)
        {
            AdminUpdates au = new AdminUpdates();
            au.AddEditImpact(-1, txtImpact.Text);
            listImpact();
            txtImpact.Text = "";
        }

        #endregion

        #region Period

        private void listPeriod()
        {
            gvPeriod.DataSource = ad.getPeriod();
            gvPeriod.DataBind();
        }

        protected void gvPeriod_RowEditing(object sender, GridViewEditEventArgs e)
        {
            btnAddPeriod.Enabled = false;
            gvPeriod.EditIndex = e.NewEditIndex;
            listPeriod();
        }

        protected void gvPeriod_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
        {
            e.Cancel = true;
            gvPeriod.EditIndex = -1;
            listPeriod();
        }

        protected void gvPeriod_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            GridViewRow row = gvPeriod.Rows[e.RowIndex];

            TextBox txtPeriodDesc = (TextBox)row.FindControl("txtPeriod");

            int periodID = Int32.Parse(gvPeriod.DataKeys[e.RowIndex].Value.ToString());
            string periodDesc = txtPeriodDesc.Text;

            AdminUpdates au = new AdminUpdates();
            au.AddEditPeriod(periodID, periodDesc);

            gvPeriod.EditIndex = -1;
            listPeriod();
            btnAddPeriod.Enabled = true;
        }

        protected void btnAddPeriod_Click(object sender, EventArgs e)
        {
            AdminUpdates au = new AdminUpdates();
            au.AddEditPeriod(-1, txtAddPeriod.Text);
            listPeriod();
            txtAddPeriod.Text = "";
        }

        #endregion

        #region Issue

        private void listIssue()
        {
            gvIssue.DataSource = ad.getIssue();
            gvIssue.DataBind();
        }

        protected void gvIssue_RowEditing(object sender, GridViewEditEventArgs e)
        {
            btnAddIssue.Enabled = false;
            gvIssue.EditIndex = e.NewEditIndex;
            listIssue();
        }

        protected void gvIssue_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
        {
            e.Cancel = true;
            gvIssue.EditIndex = -1;
            listIssue();
        }

        protected void gvIssue_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            GridViewRow row = gvIssue.Rows[e.RowIndex];

            TextBox txtIssueDesc = (TextBox)row.FindControl("txtIssue");

            int issueID = Int32.Parse(gvIssue.DataKeys[e.RowIndex].Value.ToString());
            string issueDesc = txtIssueDesc.Text;

            AdminUpdates au = new AdminUpdates();
            au.AddEditIssue(issueID, issueDesc);

            gvIssue.EditIndex = -1;
            listIssue();
            btnAddIssue.Enabled = true;
        }

        protected void btnAddIssue_Click(object sender, EventArgs e)
        {
            AdminUpdates au = new AdminUpdates();
            au.AddEditIssue(-1, txtAddIssue.Text);
            listIssue();
            txtAddIssue.Text = "";
        }

        #endregion 
    }
}
Community
  • 1
  • 1
Bee
  • 21
  • 3
  • 1
    Does it show which file the problem occurs in? Can you show the code of that file? – Patrick Hofman Aug 20 '15 at 13:35
  • The full error is Compiler `Error Message: CS0120: An object reference is required for the non-static field, method, or property 'CallLog.Admin.System'`, and it doesn't point me to a line that gives an issue other than the lines in the 'temporary file' above – Bee Aug 20 '15 at 13:45
  • Any place in the code of your page where you use `CallLog.Admin.System`? – Patrick Hofman Aug 20 '15 at 13:47
  • Nope, the top of the page only has the (standard?) `<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="false" EnableEventValidation="false" CodeBehind="Admin.aspx.cs" Inherits="CallLog.Admin" %>` – Bee Aug 20 '15 at 13:51
  • Please show the entire code file. – Patrick Hofman Aug 20 '15 at 14:33
  • Sure, please see edit in original question – Bee Aug 20 '15 at 14:45
  • Can't see any problem in there. – Patrick Hofman Aug 20 '15 at 14:53

2 Answers2

0

I think, you are having same name for both class and namespace, could you please check, it might be the cause of this issue.

Kunal Khatri
  • 451
  • 3
  • 12
  • I don't think so, the namespace is CallLog and the class is Admin – Bee Aug 20 '15 at 14:08
  • So what is `System` then? – Patrick Hofman Aug 20 '15 at 14:12
  • I wish I knew! From Admin.cs.aspx.designer.cs (which is an generated file, from the looks of it) `System`, is declared as: `protected global::System.Web.UI.HtmlControls.HtmlGenericControl System;`, but I'm not quite sure what the purpose of system is, and it seems to be in the middle of this entire mess – Bee Aug 20 '15 at 14:22
0

As, usual, I found the solution to my own problem (two cups of coffee and eight full hours of sleep later - not in that order).

The problem was that in Admin.aspx, the first div with id=System forced the Admin.aspx.designer.cs file to generate a System.Web.UI.HtmlControls.HtmlGenericControl variable called System.

This caused some sort of confusion for the compiler (is that even an actual thing?) because of the System namespace.

This was a good lesson in what not to do.

Bee
  • 21
  • 3