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

  • 問題

  • 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? 

    2022年6月28日 下午 07:37

所有回覆

  • 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`?
    2022年6月30日 上午 06:08
  • 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?

    2022年7月3日 下午 12:15
  • 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. :-(
    2022年7月5日 上午 04:29
  • 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

    2022年7月6日 上午 08:29