Hello,
I just finished reading chapter 5. So, I tried to code a simple page using Student Inherits Person. I started by creating an App_Code folder. I added the class Person.
vb. and coded the following:
Code:
Imports Microsoft.VisualBasic
Public Class Person
Private _firstName As String
Public Property FirstName As String
Get
Return _firstName
End Get
Set(ByVal value As String)
' force FirstName to begin with a capital letter:
If Not String.IsNullOrEmpty(value) Then
_firstName = value.Substring(0, 1).ToUpper _
& value.Substring(1)
Else
_firstName = String.Empty
End If
End Set
End Property
Private _lastName As String
Public Property LastName As String
Get
Return _lastName
End Get
Set(ByVal value As String)
' force LastName to begin with a capital letter:
If Not String.IsNullOrEmpty(value) Then
_lastName = value.Substring(0, 1).ToUpper _
& value.Substring(1)
Else
_lastName = String.Empty
End If
End Set
End Property
End Class
Next, in the App_Code folder, I created Student.
vb and coded the following:
Code:
Imports Microsoft.VisualBasic
Public Class Student Inherits Person
Private _studentID As String
Public Property StudentID As String
Get
Return _studentID
End Get
Set(ByVal value As String)
_studentID = value
End Set
End Property
End Class
However, "Inherits Person" is underlined and the error description is "End of Statement expected."
Please tell me how I should correct this?