M
michel
Hi,
i created a class 'test' with a method 'descrlimit()' (no matter).
That method is used in a lot of pages in the application, so i need to put
this code a lot of time: "Dim odescr As New test"
In order to avoid that, i wonder whether it would be possible to put that
line in a central place, like global.asax.
I tried this:
class file
--------
Public Class test
Public Function descrlimit(ByVal descr As Object) As String
Dim tmp As String = descr.ToString()
....
Return tmp
End Function
global.asax
-----------
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Dim odescr As New test
Application.Add("odescr", odescr)
End Sub
But it generates in all pages which use that method the error: "Name
'odescr' is not declared"
Thanks for helping
Michel
i created a class 'test' with a method 'descrlimit()' (no matter).
That method is used in a lot of pages in the application, so i need to put
this code a lot of time: "Dim odescr As New test"
In order to avoid that, i wonder whether it would be possible to put that
line in a central place, like global.asax.
I tried this:
class file
--------
Public Class test
Public Function descrlimit(ByVal descr As Object) As String
Dim tmp As String = descr.ToString()
....
Return tmp
End Function
global.asax
-----------
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Dim odescr As New test
Application.Add("odescr", odescr)
End Sub
But it generates in all pages which use that method the error: "Name
'odescr' is not declared"
Thanks for helping
Michel