Solved

Visual Studio 2010 ascx.cs files

Posted on 2010-08-19
3
731 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

756 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