how to access application.get from generic handler

1.8k views Asked by At

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!

1

There are 1 answers

0
KV Prajapati On BEST ANSWER

You have Context parameter of ProcessRequest method through which you can access the page objects.

Dim value=context.Application.Get("key")