0

My vb.net module with .request or .response is causing compiler error "reference to a non-shared member requires an object reference"

I just moved a working function with .response and .request from my ...aspx.vb form file to a new module.vb file, and now get this compiler error.

When my ..aspx.vb code calls the new function with the .response & .request in the module does it need to pass an object reference somehow?

Doug Null
  • 7,989
  • 15
  • 69
  • 148
  • 1
    possible duplicate of [Reference to a non-shared member requires an object reference occurs when calling public sub](http://stackoverflow.com/questions/13462479/reference-to-a-non-shared-member-requires-an-object-reference-occurs-when-callin) – mason Aug 17 '14 at 14:31
  • `System.Web.HttpContext.Current.Request` and `System.Web.HttpContext.Current.Response`, you have to add reference to `System.Web` to the project. – Shadow The GPT Wizard Aug 17 '14 at 14:33

1 Answers1

0

Thanks, Shadow Wizard. That was correct answer:

System.Web.HttpContext.Current.Request System.Web.HttpContext.Current.Response

Doug Null
  • 7,989
  • 15
  • 69
  • 148