how to access application.get from generic handler
-
26-06-2021 - |
Domanda
I have a global.asax in which I define some variables that I want to be available throughout the application, such as a class to handle certain database requests. In an aspx page, I can access these variables/objects using for example in Visual Basic:
dim dataMan as clsData = application.get("dataGofer")
My question: is it possible to call this from a generic handler (.ashx file)? If so, can you please show me a code snippet? Thanks!
Soluzione
You have Context
parameter of ProcessRequest
method through which you can access the page objects.
Dim value=context.Application.Get("key")
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow