Last post Jan 02, 2010 02:39 PM by Suttle
Jan 01, 2010 09:02 PM|Suttle|LINK
I have a class named "Person" defined in the App_Code folder with Visual Web Developer 2008 Express Edition. It was working fine when I set it up the other day. Now, I get the message "BC30002: Type 'Person' is not defined" when I reference the class in
my code behind page.
Partial Class Demos_DemoPerson
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnButton1.Click
Dim myPerson As New Person()
myPerson.FirstName = ""
Label1.Text = myPerson.FirstName
What possible things would not make it work now? Thanks.
Visual Web Developer 2008 Express Edition
.NET 2.0 codebehind
Jan 02, 2010 02:19 AM|muhammedsalimp|LINK
These solutions may help you..
Jan 02, 2010 02:36 AM|Waqar_ali|LINK
both file are in same namespace?
Jan 02, 2010 10:53 AM|Suttle|LINK
As far as I can tell, they are in the same namespace. Is there a way to positively tell? The class does not define a namespace. It simply resides in the App_Code directory of the site in a file named Person.vb. Shouldn't that make it recognized? Thanks
Public Class Person
Private _firstName As String
Public Property FirstName() As String
Set(ByVal value As String)
If Not String.IsNullOrEmpty(value) Then
_firstName = value.Substring(0, 1).ToUpper() & value.Substring(1)
_firstName = "YouMustHaveAName"
Jan 02, 2010 02:39 PM|Suttle|LINK
Thanks, I resolved the problem. I was trying to manually create and force an App_Code directory in the \site directory where my project resides. When I let Visual Web Developer 2008 Express Edition create its own App_Code directory in the root of what, I
guess, it recognizes as the root of the Web site, then the classes in the App_Code directory are recognized.