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!!!!!!