Connecting Tech Pros Worldwide Forums | Help | Site Map

"the name <some control> does not exist in the current context"

Newbie
 
Join Date: Aug 2008
Posts: 3
#1: Aug 5 '08
Hi,

i was trying to find a web application and i found one open source on the internet. i put the code folders on the root folder and when i tried to acces via web browser it all worked fine ( i am using IIS). But i want to make some custom changes on the forms and some functionalites. To do so, i created my own project on Visual Studio 2005, and copied the origanal code folders to my project folder and added those existing items on visual studio with the same folder hierarchy. But when i try to compile it gives me the error "the name <some control> does not exist in the current context" for all controls in the project. Besides i drag and drop a control on a page but intellisense does not recognize the control in the cs file.

i am new to aspx and c# and i got stuck at this point. i searched the internet through one whole day but i couldn't solve the problem. i would really appreciate any help.

Thank you..

nateraaaa's Avatar
Expert
 
Join Date: May 2007
Location: Illinois
Posts: 663
#2: Aug 5 '08

re: "the name <some control> does not exist in the current context"


Most likely the controls in your html do not match with the control names (id) in your code behind file. Verify that whatever you set the id of each control in your html to is also the same as the control id used in your code behind.

Nathan
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#3: Aug 5 '08

re: "the name <some control> does not exist in the current context"


You also need to check the top of your files to make sure the CS file is linked to the correct aspx page and vice versa. The full name has to be an exact match too.
It took me awhile to figure out that one when I moved a file from one folder to another and it started having all kinds of errors.
Reply