T
tshad
I am trying to set up some shared functions in my Global.asax file and can't
seem to get it to work.
In my Global.asax:
Public Class myUtils
inherits System.Web.HttpApplication
public shared function tom() as string
tom = "This is the shared sub"
end function
end class
In my page I do:
dim temp as string
temp = myUtils.tom()
response.write("temp = ")
This gives me an error:
Compiler Error Message: BC30451: Name 'myUtils' is not declared.
Source Error:
Line 34: Sub Page_Load(sender as Object, e as EventArgs)
Line 35: dim temp as string
Line 36: temp = myUtils.tom()
Line 37:
Line 38: response.write("temp = ")
Did I not define this correctly?
Do I need to import something? I was putting it into the Global.asax so I
wouldn't have to.
Thanks,
Tom
seem to get it to work.
In my Global.asax:
Public Class myUtils
inherits System.Web.HttpApplication
public shared function tom() as string
tom = "This is the shared sub"
end function
end class
In my page I do:
dim temp as string
temp = myUtils.tom()
response.write("temp = ")
This gives me an error:
Compiler Error Message: BC30451: Name 'myUtils' is not declared.
Source Error:
Line 34: Sub Page_Load(sender as Object, e as EventArgs)
Line 35: dim temp as string
Line 36: temp = myUtils.tom()
Line 37:
Line 38: response.write("temp = ")
Did I not define this correctly?
Do I need to import something? I was putting it into the Global.asax so I
wouldn't have to.
Thanks,
Tom