Foros del Web » Programación para mayores de 30 ;) » .NET »

Problema Con Class

Estas en el tema de Problema Con Class en el foro de .NET en Foros del Web. Buenas gente, tratando de meterle algo de mano al ASP.NET, me cree una class Persoon. Esta la escribi en vb.net la compilo con el studio.net ...
  #1 (permalink)  
Antiguo 23/10/2004, 14:57
 
Fecha de Ingreso: noviembre-2001
Ubicación: Groningen
Mensajes: 175
Antigüedad: 22 años, 5 meses
Puntos: 0
Problema Con Class

Buenas gente,

tratando de meterle algo de mano al ASP.NET, me cree una class Persoon.
Esta la escribi en vb.net

la compilo con el studio.net y guardo el dll en el directorio bin de la aplicacion web en cuestion..

Estoy haciendo algo mal o me falta hacer algo, pues cuando trato de crear una referencia a la clase creada ocurre un error...

agradeceria cualquier ayuda...

Código:
 Compiler Error Message: BC30182: Type expected.

Source Error:

Line 12: <script runat="server">
Line 13: 	
Line 14: 	Dim p As New Persoon()
Line 15: 	Dim p As New Persoon("Edgardo", "", "Moguella", "[email protected]")
Line 16: 	


Source File: D:\w3sites\JSNETFRAMED\persoon.aspx    Line: 14

El codigo de la classe es el siguiente.

Código:
Public Class Persoon

    Private _naam As String
    Private _voornaam As String
    Private _tussenvoegsels As String

    Private _geboortedatum As Date

    Private _adres As String
    Private _postcode As String
    Private _plaats As String

    Private _telefoon As String
    Private _mobiel As String
    Private _fax As String

    Private _email As String
    Private _url As String

    Public Property Naam() As String
        Get
            Naam = _naam
        End Get
        Set(ByVal Value As String)
            _naam = Value
        End Set
    End Property

    Public Property Voornaam() As String
        Get
            VoorNaam = _voornaam
        End Get
        Set(ByVal Value As String)
            _voornaam = Value
        End Set
    End Property

    Public Property Tussenvoegsels() As String
        Get
            Tussenvoegsels = _tussenvoegsels
        End Get
        Set(ByVal Value As String)
            _tussenvoegsels = Value
        End Set
    End Property

    Public Property GeboorteDatum() As Date
        Get
            GeboorteDatum = _geboortedatum
        End Get
        Set(ByVal Value As Date)
            _geboortedatum = Value
        End Set
    End Property

    Public Property Adres() As String
        Get
            Adres = _adres
        End Get
        Set(ByVal Value As String)
            _adres = Value
        End Set
    End Property

    Public Property PostCode() As String
        Get
            PostCode = _postcode
        End Get
        Set(ByVal Value As String)
            _postcode = Value
        End Set
    End Property

    Public Property Plaats() As String
        Get
            Plaats = _plaats
        End Get
        Set(ByVal Value As String)
            _plaats = Value
        End Set
    End Property

    Public Property Telefoon() As String
        Get
            Telefoon = _telefoon
        End Get
        Set(ByVal Value As String)
            _telefoon = Value
        End Set
    End Property

    Public Property Mobiel() As String
        Get
            Mobiel = _mobiel
        End Get
        Set(ByVal Value As String)
            _mobiel = Value
        End Set
    End Property

    Public Property Fax() As String
        Get
            Fax = _fax
        End Get
        Set(ByVal Value As String)
            _fax = Value
        End Set
    End Property

    Public Property EMail() As String
        Get
            EMail = _email
        End Get
        Set(ByVal Value As String)
            _email = Value
        End Set
    End Property

    Public Sub New()
        _naam = ""
        _voornaam = ""
        _tussenvoegsels = ""

        _geboortedatum = Now

        _adres = ""
        _postcode = ""
        _plaats = ""

        _telefoon = ""
        _mobiel = ""
        _fax = ""

        _email = ""
        _url = ""
    End Sub

    Public Sub New(ByVal Voornaam As String, ByVal Tussenvoegsels As String, ByVal Naam As String, ByVal Email As String)
        _naam = Naam
        _voornaam = Voornaam
        _tussenvoegsels = Tussenvoegsels

        _geboortedatum = Now

        _adres = ""
        _postcode = ""
        _plaats = ""

        _telefoon = ""
        _mobiel = ""
        _fax = ""

        _email = Email
        _url = ""
    End Sub

    Protected Overrides Sub Finalize()
        MyBase.Finalize()
    End Sub
End Class
la siguiente pagina aspx hace use de la clase arriba definida, o por lo menos eso es lo que quiero que suceda...
Código:
<%@ Page language="VB" %>
<%@ Import Namespace="Persoon"%>
		
<script runat="server">
	
	Dim p1 As New Persoon()
	Dim p2 As New Persoon("Edgardo", "", "Moguella", "[email protected]")
	
</script>
<html>
	<head>
		<title>Welcome</title>
   </head>
	<body>
<ASP:Label ID="Errorlabel">
<ASP:Label ID="Finishedlabel">

   </body>
</html>

Última edición por EDGARDO MOGUELLA; 23/10/2004 a las 15:10
  #2 (permalink)  
Antiguo 24/10/2004, 02:10
 
Fecha de Ingreso: noviembre-2001
Ubicación: Groningen
Mensajes: 175
Antigüedad: 22 años, 5 meses
Puntos: 0
resuelto

je, je me costo un dia pero salio..

como comente estoy empezando con .net asi que la respuesta salia por el lado del desconocimiento .

el error surgia de no tener en cuenta el scope de las variables definidas...

edgardo
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 19:44.