Richardo Burton

Richardo Burton

  • NA
  • 23
  • 1.1k

I am having problems accessing classes in subfolders

Nov 1 2020 1:33 AM
The CarModel class is in a sub folder and the Default.aspx.cs file is in another folder. i am having trouble accessing the CarModel class through Default.aspx.cs.

Answers (6)

5
Sachin Singh

Sachin Singh

  • 7
  • 55.8k
  • 83.6k
Nov 1 2020 4:13 AM
Right click on reference (default aspx project) Add reference -->Solution--> Select your car model project (namespace)
Accepted Answer
3
Kiran Mohanty

Kiran Mohanty

  • 466
  • 2.8k
  • 310.1k
Nov 1 2020 2:04 AM
Hi,
Please import your class file namespace in the required aspx.cs file.
Ex:-
using ProjectName.FolderName; ( CarModel class namespace)
1
Richardo Burton

Richardo Burton

  • 0
  • 23
  • 1.1k
Nov 1 2020 4:29 AM
Worked Thanks a lot.
1
Richardo Burton

Richardo Burton

  • 0
  • 23
  • 1.1k
Nov 1 2020 2:42 AM
The structure and code file is in the zipped folder.
1
Kiran Mohanty

Kiran Mohanty

  • 466
  • 2.8k
  • 310.1k
Nov 1 2020 2:27 AM
I guess your folder name and name space are different. can you please post your code with project structure snapshot ?
1
Richardo Burton

Richardo Burton

  • 0
  • 23
  • 1.1k
Nov 1 2020 2:12 AM
Thank you, but it is still not working. When I try to include the App_Code folder. I am still getting an error.