Last post Jul 27, 2011 02:33 AM by Mamba Dai - MSFT
Jul 22, 2011 09:34 AM|gmannh|LINK
I have a class (see below)
Public Class ClientProfile
Private _FirstName As Integer
Public Property FirstName() As Integer
Set(ByVal value As Integer)
_FirstName = value
Private _LastName As Double
Public Property LastName() As Double
Set(ByVal value As Double)
_LastName = value
It is in the file ClientProfile I have placed in both App_Code and also App_Code/Models
In my code behind I have the following
Dim NewClient As New ClientProfile
The last word, "ClientProfile" has the scary squiggly red line below it. It is not recognizing my class.Even the Intellisense is not picking up te class.
Do I have to register the class file in any way?
Jul 22, 2011 01:06 PM|DarrellNorton|LINK
Have you done a CLEAN and then REBUILD (not just build)? That usually works.
Jul 22, 2011 01:10 PM|princeG|LINK
if you are using namespace with class then use/import namespace with it. but make sure you clean the solution and rebuild it again.
Jul 22, 2011 01:38 PM|gmannh|LINK
Clean and Rebuild did not work.
I moved the class .vb file from app_code/models to app_code to the web's root. I cleaned and rebuilt each time and it did not seem to recognize it.
I also tried to add the NameSpace to the class .vb file, and then in the code-behind and added the IMPORTS ClientProfile, it did not seem to recognize it.
I am at a loss.
Jul 27, 2011 02:33 AM|Mamba Dai - MSFT|LINK
Please check this tutorial and then recreate a web application to test the class of App_Code.
By the way, this topic about Shared Code Folder in ASP.NET Web site you may have a check: