help me create a simple class
hi
can someone please help me out
for now all i want to do is create an external dll file which is compiled using vbc. i know how to compile a .vb file
once its compiled i want to use it inside my aspx code something like this
textbox1.text = MyClass.Connection(1)
this should insert the following text in the textbox1: "hello"
and if i type
textbox1.text = MyClass.Connection(2)
it should give "bye" in the textbox instead!
please help!
Re: help me create a simple class
Create a New Project and under Visual Basic Projects, chose a Class Library (this will create a DLL). To reference it in your ASP.NET app, add a reference to the DLL (over there on the right, right click reference, select add reference, and browse to it).
Re: help me create a simple class
thanks
but that do i type in this class do make it do what i want it to do?
Re: help me create a simple class
In your class called MyClass, create a function which returns a string.
VB Code:
Public Function Connection(ByVal Switch As Integer) As String
Select Case Switch
Case 1
Return "Hello"
Case 2
Return "World!"
Case 3
Return "Mendhak"
Case Else
Return "unknown"
End Select
End Function