aspx coce :
---------------------
Private Sub btnTestOutputFromAspx_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTestOutputFromAspx.Click
Dim Name As String = "Bob"
Response.Write(Name)
End Sub
Private Sub btnbtnTestOutputFromClass_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbtnTestOutputFromClass.Click
Dim MyCode As New CodeLibrary
MyCode.TestOutputDll("Test Output from a class")
End Sub
class code:
-----------------
Public Sub TestOutputDll(ByVal Name As String)
Response.Write(Name)
End Sub
I am not sure if I am not suppose to use Response.Write from within a class and I should get the value back to the aspx page as a return value then I do the following
Dim ReturnValue as string
Dim MyCode As New CodeLibrary
ReturnValue = MyCode.TestOutputDll
Response.Write ReturnValue
So which is the correct way . I am talking here concept issue. I am new to class programming and would like to learn the right way of doing things.
thanks
Ehx
---------------------
Private Sub btnTestOutputFromAspx_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTestOutputFromAspx.Click
Dim Name As String = "Bob"
Response.Write(Name)
End Sub
Private Sub btnbtnTestOutputFromClass_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbtnTestOutputFromClass.Click
Dim MyCode As New CodeLibrary
MyCode.TestOutputDll("Test Output from a class")
End Sub
class code:
-----------------
Public Sub TestOutputDll(ByVal Name As String)
Response.Write(Name)
End Sub
I am not sure if I am not suppose to use Response.Write from within a class and I should get the value back to the aspx page as a return value then I do the following
Dim ReturnValue as string
Dim MyCode As New CodeLibrary
ReturnValue = MyCode.TestOutputDll
Response.Write ReturnValue
So which is the correct way . I am talking here concept issue. I am new to class programming and would like to learn the right way of doing things.
thanks
Ehx