Re: Is there a way to obtain a Session object other than the current one ?

From: SFX (noreply_at_softwarefx.com)
Date: 08/08/04


Date: Sat, 7 Aug 2004 21:19:05 -0400


> You say that you can't send using the "same headers of the current page".
> But there is no such thing as the "headers of the current page". Pages
don't
> have headers, requests and responses do. In fact, it's likely that several
> requests and responses are responsible for the objects on the page
(images,
> scripts, stylesheets, etc.)

When I said "same headers of the current page" I should have said "the
headers that were sent to the server when the html page currently being
displayed inside the browser was requested". I just thought I could
abbreviate a little.

> Give it some thought. It's not too surprising that you have a problem
trying
> to get the control to act like the page, since it isn't actually the page.
> Instead, perhaps you can get the page to be itself. Keeping the
> functionality with the object to which it most naturally belongs is one
> definition of encapsulation (of function).

I have (given it a lot of thought !). I think you are assuming a little too
much based just in my posting, which I made as concrete as possible in hopes
of getting a concrete answer.

Let me try to explain the headers ordeal in more detail.

Imagine you have a page like this:

<BODY>
<img src="/MyImage.gif"/>
</BODY>

When a request for MyImage.gif is sent to the server, ALL OF THE RELEVANT
headers such as cookies, user, user agent, etc. are sent JUST as when the
page containing this image tag was requested (more or less, anyways, new
cookies could have been created in the current request, but that's too much
detail for this discussion).

This is all I want. I (the client control) want to be like the <img> tag.
The <img> is not the page an yet it makes the request the way I want to make
it. So I'm not trying to be the page, if anything I'm trying to be an <img>
tag. That's not too much to ask, is it ?

> Is it possible for a hosted Windows Forms control to raise events which
are
> handled in script in the same page?

No. Not managed anyways, a call to explorer (to execute the script) is
considered un-managed. In an ActiveX control, there is absolutely no
problem, I can get a hold of the Browser interface and tell it to make the
request for me instead of doing it myself, this way I don't have to worry
about headers. Unfortunately, there is nothing similar in .NET. (I can do it
unmanaged but then my control would require full-trust which misses the
point of .NET controls).

Anyways, I did not intend to go into this discussion about headers and
client controls in this posting for two reasons:

1) I already know pretty much what can and can't be done.
2) This is an ASP.NET forum, not Windows Form.

I just fell compelled to explain the reason for my need.

My original question remains unanswered:

Can I get a session object for a session other than the current assuming I
have the id for such session.

If the answer is no, why ?

It was nice talking to you.

-- 
FP
Software FX