|
-
Aug 1st, 2005, 11:45 AM
#1
Thread Starter
Member
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!
-
Aug 1st, 2005, 03:56 PM
#2
Frenzied Member
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).
Sean
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
-
Aug 2nd, 2005, 03:33 AM
#3
Thread Starter
Member
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?
-
Aug 2nd, 2005, 03:53 AM
#4
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|