0

İ create a project "Deneme". create a folder as "App_Code" and create a class Islem in this folder. Then i create new aspx page but i couldn't see this class.error message is "Deneme is available Deneme is not availabe" I couldn't understand. My friend cab see this class on his computer but I can't. I created a new webform default.aspx. I couldn't reach this class, but I can reach webform1.aspx in this folder.

enter image description here

enter image description here

techraf
  • 64,883
  • 27
  • 193
  • 198

3 Answers3

0

Troubleshooting when you can't find a class

While working on the project, open the "Object Browser" from the "View" menu. Then in the textbox labeled "Search" type in "Islem" and see what comes up.

If the class doesn't come up at all, you're in the wrong project, or you didn't add the class like you think you did, or it's a different project and you need to add a reference.

If it does come up, take careful note of the class' complete namespace.

My guess

My guess is that you have a mismatch on the namespace. By creating the folder you created a sub-namespace by default, so you probably need to add something like this to the top of your code:

using Deneme.App_Code

or, if you don't want to add that for some reason, you can instantiate an instance of the class using its full name:

var o = new Deneme.App_Code.Islem();

Another guess

Make sure Islem.cs is set to compile. See this answer for instructions.

Community
  • 1
  • 1
John Wu
  • 50,556
  • 8
  • 44
  • 80
0

This is a weird situation but try this. Go to 14 line in your Default.aspx.cs file and press ctrl+.+enter then you will have a new Islem file i the root of your project. Rebuild and then your error will disappear. Then copy the code inside your original Islem to the new generated file. Remove the old Islem and move the new one to App_Code. Hope this help you.

Keshan Nageswaran
  • 8,060
  • 3
  • 28
  • 45
afonte
  • 938
  • 9
  • 17
0

provide namespace in your Islem.cs like this

namespace Deneme
{
 public class Islem
 {
    // .... logic
 }
}

create new class in App_Code folder, there is no namespace by default. so you can no access it.