How do I get the current HttpContext when I'm in a Class Library (not from
within an ASP.NET page)? I seem to remember calling GetCurrent from somewhere
before but don't remember the details. The business object is being used from
within a Web app, so there should be an HttpContext available...just can't
get it.
Thanks,
Jay 6 1041
You can use System.Web.HttpContext.Current
"Jay Williams" <Ja*********@discussions.microsoft.com> wrote in message
news:0B**********************************@microsof t.com... How do I get the current HttpContext when I'm in a Class Library (not from within an ASP.NET page)? I seem to remember calling GetCurrent from somewhere before but don't remember the details. The business object is being used from within a Web app, so there should be an HttpContext available...just can't get it.
Thanks, Jay
You should be able to get the Current Context by :
"Jay Williams" <Ja*********@discussions.microsoft.com> wrote in message
news:0B**********************************@microsof t.com... How do I get the current HttpContext when I'm in a Class Library (not from within an ASP.NET page)? I seem to remember calling GetCurrent from somewhere before but don't remember the details. The business object is being used from within a Web app, so there should be an HttpContext available...just can't get it.
Thanks, Jay
Opps sorry:
System.Web.HttpContext.Current
"Jay Williams" <Ja*********@discussions.microsoft.com> wrote in message
news:0B**********************************@microsof t.com... How do I get the current HttpContext when I'm in a Class Library (not from within an ASP.NET page)? I seem to remember calling GetCurrent from somewhere before but don't remember the details. The business object is being used from within a Web app, so there should be an HttpContext available...just can't get it.
Thanks, Jay
Unfortunately, when I type "System.Web...", all Intellisense shows me is
three methods having to do with AspNetHostingPermission.... Nothing else.
That's why I need to call GetCurrent from somewhere, I think.
Jay
"Marina Levit [MVP]" wrote: You can use System.Web.HttpContext.Current
"Jay Williams" <Ja*********@discussions.microsoft.com> wrote in message news:0B**********************************@microsof t.com... How do I get the current HttpContext when I'm in a Class Library (not from within an ASP.NET page)? I seem to remember calling GetCurrent from somewhere before but don't remember the details. The business object is being used from within a Web app, so there should be an HttpContext available...just can't get it.
Thanks, Jay
You need to reference System.Web.dll in your project. The VS template for
non-web projects does not include it by default.
"Jay Williams" <Ja*********@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com... Unfortunately, when I type "System.Web...", all Intellisense shows me is three methods having to do with AspNetHostingPermission.... Nothing else.
That's why I need to call GetCurrent from somewhere, I think.
Jay
"Marina Levit [MVP]" wrote:
You can use System.Web.HttpContext.Current
"Jay Williams" <Ja*********@discussions.microsoft.com> wrote in message news:0B**********************************@microsof t.com... > How do I get the current HttpContext when I'm in a Class Library (not > from > within an ASP.NET page)? I seem to remember calling GetCurrent from > somewhere > before but don't remember the details. The business object is being > used > from > within a Web app, so there should be an HttpContext available...just > can't > get it. > > Thanks, > Jay
The suspense is killing me!
By what?
I think part of your response got lost.
"Anthony Merante" wrote: You should be able to get the Current Context by :
"Jay Williams" <Ja*********@discussions.microsoft.com> wrote in message news:0B**********************************@microsof t.com... How do I get the current HttpContext when I'm in a Class Library (not from within an ASP.NET page)? I seem to remember calling GetCurrent from somewhere before but don't remember the details. The business object is being used from within a Web app, so there should be an HttpContext available...just can't get it.
Thanks, Jay This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Leon |
last post by:
I'm Building a Code Library in VS.NET 2003 to be reference within my ASP.NET
web application.
However, within my Code Library I have an AppException.vb page that keep
receiving the following...
|
by: Leon |
last post by:
I'm Building a Code Library in VS.NET 2003 to be reference within my ASP.NET
web application.
However, within my Code Library I have an AppException.vb page that keep
receiving the following error...
|
by: josephpage |
last post by:
I have a Visitor class that is defined in a class library.
The class has lots of parameters that are pulled from the QueryString,
the ReferrerUrl, Cookies, the Session object, etc...
I would...
|
by: tshad |
last post by:
I have a file that I converted from VB.Net to C# that works fine in VB.Net
when I compile but not in C# using the same libraries.
The error I am getting is:
PageInit.cs(9,7): error CS0138: A...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |