S
Sparky Arbuckle
How do I successfully pass a value my Business object (.vb) to my .aspx
page? Right now I am trying to use this:
Imports System
Imports Microsoft.VisualBasic
Namespace ASDFComponents
Public Class ValidateISBN
Public res As Boolean
Public checkISBN as string
Public Number As String
Public CheckDigit As String
Public CheckValue As Integer
Public CheckSum As Integer
Public i As Byte
Public Cnt As Byte
Public Function ValidateISBN(strISBN as string)
res = False
CheckDigit = UCase(Right(strISBN, 1))
Number = Trim(Replace(Left(strISBN, Len(strISBN) - 1), "-", ""))
IF (Len(Number) = 9) And (InStr(1, "0123456789X", CheckDigit) >
0) THEN
IF CheckDigit = "X" THEN
CheckSum = 10
ELSE
CheckSum = CInt(CheckDigit)
END IF
Cnt = 1
FOR i = 1 To 9
CheckSum = CheckSum + CInt(Mid(Number, i, 1)) * (11 - Cnt)
Cnt = Cnt + 1
NEXT
IF (CheckSum Mod 11 = 0) THEN res = True
END IF
checkISBN = res
RETURN res
END Function
END Class
END Namespace
--------------------
This is how I try and call that:
Sub Button_Click(s as Object, e as EventArgs)
Dim objValidateISBN as New ValidateISBN
objValidateISBN.strISBN = tbISBNNumber.text
lblResult.text = objValidateISBN.ValidateISBN(e.Value)
END Sub
When I call this in my .aspx page I get the following error:
Compiler Error Message: BC30456: 'strISBN' is not a member of
'ASDFComponents.ValidateISBN'.
Does anyone see what exactly it is that I'm doing wrong? I've uploaded
a .dll file that I compiled into my /bin directory. I'm stuck!
page? Right now I am trying to use this:
Imports System
Imports Microsoft.VisualBasic
Namespace ASDFComponents
Public Class ValidateISBN
Public res As Boolean
Public checkISBN as string
Public Number As String
Public CheckDigit As String
Public CheckValue As Integer
Public CheckSum As Integer
Public i As Byte
Public Cnt As Byte
Public Function ValidateISBN(strISBN as string)
res = False
CheckDigit = UCase(Right(strISBN, 1))
Number = Trim(Replace(Left(strISBN, Len(strISBN) - 1), "-", ""))
IF (Len(Number) = 9) And (InStr(1, "0123456789X", CheckDigit) >
0) THEN
IF CheckDigit = "X" THEN
CheckSum = 10
ELSE
CheckSum = CInt(CheckDigit)
END IF
Cnt = 1
FOR i = 1 To 9
CheckSum = CheckSum + CInt(Mid(Number, i, 1)) * (11 - Cnt)
Cnt = Cnt + 1
NEXT
IF (CheckSum Mod 11 = 0) THEN res = True
END IF
checkISBN = res
RETURN res
END Function
END Class
END Namespace
--------------------
This is how I try and call that:
Sub Button_Click(s as Object, e as EventArgs)
Dim objValidateISBN as New ValidateISBN
objValidateISBN.strISBN = tbISBNNumber.text
lblResult.text = objValidateISBN.ValidateISBN(e.Value)
END Sub
When I call this in my .aspx page I get the following error:
Compiler Error Message: BC30456: 'strISBN' is not a member of
'ASDFComponents.ValidateISBN'.
Does anyone see what exactly it is that I'm doing wrong? I've uploaded
a .dll file that I compiled into my /bin directory. I'm stuck!