none
"The name "X" does not exist in the current context" RRS feed

  • Question

  • 1. Solution Explorer

    2. Soru.cs

    3. Default.aspx.cs (i call Neden method)

    4. Error Msg -> "The name "Soru" does not exist in the current context" 

    Why? 

    Tuesday, June 28, 2022 7:37 PM

All replies

  • I cannot really figure out what project type you are using, so I have a hard time replicating it. But `Default.aspx.cs` is a partial class. Could it be that a namespace is set in the other half, putting it in another namespace than `Soru.cs`?
    Thursday, June 30, 2022 6:08 AM
  • Make sure that your Soru class is in the same namespace as your _Default class.

    Is your Visual Studio VS2013 or later edition? Did you create the Soru class with 'Add - New item - Class' menu item?

    Sunday, July 3, 2022 12:15 PM
  • Make sure that your Soru class is in the same namespace as your _Default class.

    Is your Visual Studio VS2013 or later edition? Did you create the Soru class with 'Add - New item - Class' menu item?

    I managed to post two screenshots about the namespace code in my VS project. But the forum told that it needs to verify my account at first. :-(
    Tuesday, July 5, 2022 4:29 AM
  • Error Message: Compilation Error
    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
    Compiler Error Message: CS0103: The name 'xxx' does not exist in the current context

    Resolution: The error is usually caused by an error in a Custom template - (.cshtml file)
    Browse the stack trace and find the problematic piece of code based on the variable name xxx

    This May Work,

    Peter

    Wednesday, July 6, 2022 8:29 AM