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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • avecreep
    New Member
    • Aug 2008
    • 3

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

    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
    Recognized Expert Contributor
    • May 2007
    • 664

    #2
    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

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      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.

      Comment

      Working...