Module in Project

  • Thread starter Jason MacKenzie
  • Start date
J

Jason MacKenzie

I have a module in my asp.net application. How can I access the
Request.Servervariables collection from within this module?

Thanks,

Jason MacKenzie
 
K

Karl

System.Web.HttpContext.Current.Request

note that HttpContext.Current might be null if this isn't a web application
so you might wanna check for that

HttpContext current = System.Web.HttpContext.Current;
if (current != null){
//you can access current.Request safely
}

Karl
 
J

Jason MacKenzie

Thank you sir.

Karl said:
System.Web.HttpContext.Current.Request

note that HttpContext.Current might be null if this isn't a web
application
so you might wanna check for that

HttpContext current = System.Web.HttpContext.Current;
if (current != null){
//you can access current.Request safely
}

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top