The name '###' does not exist in the current context

Posted on 2009-12-18
Last Modified: 2013-11-26
Hi All,

I have no idea why I am receiving the following errors when trying to compile/build website. The error is referring to all instances of

guide_border - GenericHTMLControl (<p> tag)
litWidth - Literal  control
litHeight - Literal control
linkReset - GenericHTMLControl (<a> tag)
linkSite - GenericHTMLControl (<a> tag)

I have attached my code behind

I have checked that my ASPX file is referencing the CodFile and Partial Class correctly.
I have also checked that all controls have an ID and the attribute runat="server".

These errors only occur which building the site. What actually viewing the page in the browser, all works fine... I am using Visual Studio 2008.

Can anyone see what would be causing this?

Many thanks,

public partial class ImageEditor : System.Web.UI.Page


    protected void Page_Load(object sender, EventArgs e)


        ImageLiteral.Text = "<img src=\"/images_cust/templates/temp/" + Request.QueryString["f"] + "\" alt=\"" + Request.QueryString["tc"] + "\" id=\"i\" />";


        string strWidth = Request.QueryString["iw"];

        string strHeight = Request.QueryString["ih"];

        guide_border.Style.Add("width", strWidth + "px");

        guide_border.Style.Add("height", strHeight + "px");

        litWidth.Text = strWidth;

        litHeight.Text = strHeight;

        linkReset.HRef = "?f=" + Request.QueryString["f"] + "&tc=" +

            Request.QueryString["tc"] + "&p=" + Request.QueryString["p"] + "&iw=" + strWidth + "&ih=" + strHeight;

        linkSite.HRef = "/site/page.aspx?page=" + Request.QueryString["p"];



Open in new window

Question by:rito1
    LVL 10

    Expert Comment

    where is the html for ASPX page?
    these must be warnigs and not errors.
    LVL 9

    Accepted Solution

    Take a look at this article:
    Here's a highlight:
    Take a look at you aspx.designer.cs file ;)
    If, there's no problem over there, try it:
    LVL 9

    Expert Comment

    LVL 1

    Author Closing Comment

    Excellent, thanks. It was due to having a backup copy of the files in my solutions.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now