• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 608
  • Last Modified:

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

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

  • 2
1 Solution
where is the html for ASPX page?
these must be warnigs and not errors.
Take a look at this article: http://forums.asp.net/t/1026129.aspx 
Here's a highlight:
Take a look at you aspx.designer.cs file ;)
If, there's no problem over there, try it:
rito1Author Commented:
Excellent, thanks. It was due to having a backup copy of the files in my solutions.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now