Solved

Visual Studio 2010 ascx.cs files

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

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

746 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

12 Experts available now in Live!

Get 1:1 Help Now