M
MattB
Hi. I have a asp.net/vb.net application I'm working on and I want to add
some shared functions for some frequently used code. I've put one in my
global.asax.vb file as that seemed like a good place to call from elsewhere
in the app. Is that an accepted practice? Then, to call it in another
aspx.vb file I stumbled across this way to do it:
dim oGbl as new global
myString = oGbl.MyFunction(arg1, arg2)
Is this a good way to do this? Should I do it another way (for efficency,
speed, etc). That particular function just Returns a string when called.
Also, I'd like to have another function with several properties I could
access, like this:
if oGbl.MyFunction.Success() then
myString = oGbl.MyFunction.RetString
end if
I'm not sure how to declare or assign those properties within the function
code (Success would be boolean)data. Any tips or examples? Thanks!
some shared functions for some frequently used code. I've put one in my
global.asax.vb file as that seemed like a good place to call from elsewhere
in the app. Is that an accepted practice? Then, to call it in another
aspx.vb file I stumbled across this way to do it:
dim oGbl as new global
myString = oGbl.MyFunction(arg1, arg2)
Is this a good way to do this? Should I do it another way (for efficency,
speed, etc). That particular function just Returns a string when called.
Also, I'd like to have another function with several properties I could
access, like this:
if oGbl.MyFunction.Success() then
myString = oGbl.MyFunction.RetString
end if
I'm not sure how to declare or assign those properties within the function
code (Success would be boolean)data. Any tips or examples? Thanks!