• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 601
  • 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,

Rit
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

0
rito1
Asked:
rito1
  • 2
1 Solution
 
anvCommented:
where is the html for ASPX page?
these must be warnigs and not errors.
0
 
magicdlfCommented:
Take a look at this article: http://forums.asp.net/t/1026129.aspx 
Here's a highlight:
<quote>
Take a look at you aspx.designer.cs file ;)
If, there's no problem over there, try it:
http://www.daveparslow.com/2007/10/error-name-does-not-exist-in-current.html
</quote>
0
 
rito1Author Commented:
Excellent, thanks. It was due to having a backup copy of the files in my solutions.

Rit
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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