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

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

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


Relevant Pages

  • Re: Is there a way to obtain a Session object other than the current one ?
    ... >> have headers, requests and responses do. ... >> to get the control to act like the page, ... > When a request for MyImage.gif is sent to the server, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: HTTP - basic authentication example.
    ... or *never* knowing the realm..) ... This is called authentication and is implemented ... requests a web page it sends a request to the server. ... consists of headers with certain information about the request. ...
    (comp.lang.python)
  • Re: HttpWebRequest and Host header (ANSWERED)
    ... However there is a subtle difference in the request ... headers sent with this method, and what the actual request should be ... Host: www.company.com ...
    (microsoft.public.dotnet.framework)
  • Re: Writing a file in Response
    ... IE has a history of issues with the cache related control headers. ... to the request for one reason - to force IE to make the request. ... I think at the moment it is recognising the file via extension, and not by MIME type, I can also back this up by removing MIME information from the registry and it still works. ... In the morning I am going to simply compare a working set of headers to the headers that do not work, and that should provide the answer. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Question regarding mechanize lib
    ... such as the request object. ... but I need to set the headers before the post is called... ... Added protected method Mechanize#set_headers so that subclasses ... Mechanize can now be subclassed to add any headers a user may ...
    (comp.lang.ruby)