Re: HttpContext.Current returns null
- From: "Liz" <liz@xxxxxxxxxxxxxxx>
- Date: Sat, 10 Nov 2007 14:07:43 -0600
"Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:DCDD782F-9DA1-4436-A4E6-B4EDC011E90D@xxxxxxxxxxxxxxxx
Liz,
No, you can't. The Request, Response, etc, etc, objects in ASP are
completely different than they are in ASP.NET. ASP.NET doesn't improve or
enhance ASP (technically), it completely replaced it.
Because of that, you have to get the intrinsic objects the way you
would do in ASP, which is what I pointed out, using some of the wrappers
that .NET provides for accessing COM+.
A COM component accessed in ASP would have to do the same thing to get
the Request, Response, etc, etc properties.
Nicholas -
the OP said they are running a legacy ASP application ... so he's got direct
access to Request; what he's doing with his VB6 COM component + his C#
assembly is not specified ... it all sounds very contorted and I am
wondering if it needs to be ... in all events, so far as I can see from what
was posted, the question isn't really about ASP.NET at all as they don't
appear to be using it. If he needs to pass anything from Request to his VB
component, I should think he can, no?
Are you assuming this all refers to an app being converted to ASP.NET?
maybe it is, but the post doesn't say that ... why there is a C# assembly in
the picture I have no idea ... but people decide to do all kinds of things
for all kinds of reasons, some of them better than others
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
"Liz" <liz@xxxxxxxxxxxxxxx> wrote in message
news:%23C2wom1IIHA.588@xxxxxxxxxxxxxxxxxxxxxxx
"Gilgamesh" <gilgamesh4ever@xxxxxxx> wrote in message
news:uv398jwIIHA.4272@xxxxxxxxxxxxxxxxxxxxxxx
We have a legacy ASP application which is calling a VB 6 DLL. This dll
then calls a C# dll assembly written in .net 2.0. We need to access
httpcontext in C# in order to get the request object associated with the
ASP page which initiated the request. HttpContext.Current retunes null
in C#, which indicates that the object context is not being passed from
vb dll to C# dll. Any idea why is this happening?
you can't just access Request directly in the legacy ASP app? isn't this
what you call the really long way around? which gets even worse when
Nicholas explains what it takes to do it?
hope that VB6 and C# code is doing something really useful ....
.
- Follow-Ups:
- Re: HttpContext.Current returns null
- From: Nicholas Paldino [.NET/C# MVP]
- Re: HttpContext.Current returns null
- References:
- HttpContext.Current returns null
- From: Gilgamesh
- Re: HttpContext.Current returns null
- From: Liz
- Re: HttpContext.Current returns null
- From: Nicholas Paldino [.NET/C# MVP]
- HttpContext.Current returns null
- Prev by Date: Re: Serial port in .NET
- Next by Date: Re: C# question: How do you delete a Grid object
- Previous by thread: Re: HttpContext.Current returns null
- Next by thread: Re: HttpContext.Current returns null
- Index(es):
Relevant Pages
|