Solved

Visual Studio 2010 ascx.cs files

Posted on 2010-08-19
3
732 Views
Last Modified: 2013-11-27
I am seeing:

"The name 'xxxxxx' does not exist in the curent context"

Builds correctly but any additional changes made generates the errors on all the web control id names in the ascx.cs file and any new modification does not appear on the browser even after rebuild.
0
Comment
Question by:PAR6
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 250 total points
ID: 33481854
Does your markup page have the correct details regarding your code-behind? That is to say, if your markup file is called "Example.ascx", and your code-behind page is called "Example.ascx.cs" with a class name of "Example", and you have declared your control with the namespace "MyNamespace", then you should have code which looks like the following:
// Example.ascx (C#)
<%@ Control Language="C#" CodeBehind="Example.ascx.cs" Inherits="MyNamespace.Example" %>

// Example.ascx.cs
namespace MyNamespace
{
    public partial class Example : System.Web.UI.UserControl
    {
...

Open in new window

0
 
LVL 1

Author Comment

by:PAR6
ID: 33481893
I think it has to do with the files I am working with... a published source vs. solution vs. web

Any guidance in this respect dealing with editing controls?  Do I have to re-publish from the solution each time I make changes to a control?
0
 
LVL 27

Assisted Solution

by:nmarun
nmarun earned 250 total points
ID: 33482306
To answer the last question, yes. Any time you make a change in the code, you'll have to re-publish. If your changes are 'non-code' related, like changing a javascript function, modifying the css or the just the html (div, table and such), you can just copy the modified files to the web location.

Arun
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can Selenium do Load Testing? 2 59
RestClient.cs fails at (HttpWebResponse)request.GetResponse()) 4 50
Datagridview column resizing 8 26
Intermittent OleDbConnection Error 20 51
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

739 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