Solved

Visual Studio 2010 ascx.cs files

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

912 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

25 Experts available now in Live!

Get 1:1 Help Now