Request.ServerVariables outside of a page

  • Thread starter Thread starter MattB
  • Start date Start date
M

MattB

Hello. I'm developing a site that has a bunch of shared functions in .vb
file I reuse from different pages. I'm trying to implement
Request.ServerVariables in one of those functions and have hit a snag. In
testing this out, I used the same method within a page (an aspx.vb
codebehind page) and it acted as I would expect.
When I moved that code to my .vb file for shared use, Intellisense marks my
use of Request with "Reference to a non-shared member requires an object
reference". I'm not exactly sure what I need to change to make it work like
it did as part of a page. I'm guessing that it needs a reference to the
calling page as an object to put it in context, but I don't know how to do
that. Can anyone help? Thanks!
 
System.Web.HttpContext.Current
System.Web.HttpContext.Current.Request
System.Web.HttpContext.Current.Response
System.Web.HttpContext.Current.Session
System.Web.HttpContext.Current.Application
System.Web.HttpContext.Current.Server
System.Web.HttpContext.Current.etc

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top