Hi all,
I've done several
VB.Net/ASP.Net 2003 projects, and I did 98% of a VS2005/ASP 2.0 project that a co-worker initially laid out a few screens for. However, now I’m doing a new VS2005/ASP 2.0 project, and have a stupid error. I’ve found a fair number of people asking about this on various forums, but no resolutions, and would be pathetically grateful for any help.
In a nutshell: in my aspx.
vb code, when I reference my classes in the App_Code folder, they’re “not defined”.
<Here’sWhatIDid>
1. I clicked File / New Project, and selected “ASP.Net Web Application”.
2. I right-clicked on the level below the Solution level in Solution Explorer – is this still called the Project level?, clicked Add New Item, and added a Web Form.
3. I pasted some HTML in from a similar project.
4. I right-clicked from the Designer View, clicked View Code, and pasted some
VB code in, directly from the similar project (as a starting point).
That
VB code has “Dim MyXXX As New clsXXX”, which of course gives a message “Type clsXXX is not defined”. So,
1. I click on the Project, click “Add”, click “New Folder”, and name it App_Code.
2. I then right-click on this folder, click “Add”, click “Class”, and name it clsXXX.
3. I open that new file and paste the code in from the similar project’s class file. It’s a Public Class clsXXX.
4. It doesn’t work when I “add existing item” and specify the similar older project’s class file, either.
5. The same thing is happening for my DatabaseFunctions class in DatabaseFunctions.
vb in App_Code.
<Here’sWhatIDid />
The class is still “not defined” in my aspx.
vb code, even after I rebuild everything. Even if I drag the clsXXX.
vb file up to the Project level, it’s still “not defined”.
For my DatabaseFunctions class, I also tried putting a Namespace designation in the DatabaseFunctions.
vb file and “Imports” the namespace in my aspx.
vb.
Does anybody know how to fix this? Thanks!!!!!!