Threading and Session Objects

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Threading and Session Objects

    Hi,
    I´m doing an asp.net application that uploads and downloads files and
    folders between the client and the server on my intranet. To do this I have
    create threads and it runs Ok but I need to show to the user the progress of
    the operation and here is the problem. I try to access to the Session
    Variables from inside the thread to show it on a page that automatically
    refresh, BUT, I have discovered that there is no access to the httpcontext
    from inside the new thread. Is there any other way to do this??

    Thanks a lot.

    --
    Roberto López
    Dpto. Soporte Software
    Eurosistemas Informáticos y Comunicaciones, S.L.


    Roberto López Guest

  2. Similar Questions and Discussions

    1. Using COM objects marked as "Both-Threading"
      If you call a COM object via Interop which is marked as "Both-Threading" will it still call it as an STA? Am I going to get slightly better...
    2. Decrypt / Encrypt Session objects
      Hi! I just want to know if it's common to decrypt a Session-Object in a ASP.NET application. My collegue says that I have not do this because the...
    3. Perceived Loss of All Session Objects
      > Environment: Windows 2000 Server, IIS 5.0, ASP .Net www.aspfaq.com/5002
    4. COM objects in asp.net session
      I have been tasked with migrating a legacy asp website into asp.net. The website uses COM objects in session all over the place (which is terrible...
    5. options for CGI::Session database_manager objects?
      I'm looking at the source for pgsession at the moment, and it appears that he simply puts things like the hostname, port, db_user, etc as hardcoded...
  3. #2

    Default Re: Threading and Session Objects

    Here's an article:

    [url]http://www.ftponline.com/vsm/2002_11/magazine/features/chester/[/url]

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    [url]www.aboutfortunate.com[/url]

    "Out of chaos comes order."
    Nietzche
    "Roberto López" <rlopez@eurosistemas.net> wrote in message
    news:%23Ww7zVpWDHA.2032@TK2MSFTNGP11.phx.gbl...
    > Hi,
    > I´m doing an asp.net application that uploads and downloads files and
    > folders between the client and the server on my intranet. To do this I
    have
    > create threads and it runs Ok but I need to show to the user the progress
    of
    > the operation and here is the problem. I try to access to the Session
    > Variables from inside the thread to show it on a page that automatically
    > refresh, BUT, I have discovered that there is no access to the httpcontext
    > from inside the new thread. Is there any other way to do this??
    >
    > Thanks a lot.
    >
    > --
    > Roberto López
    > Dpto. Soporte Software
    > Eurosistemas Informáticos y Comunicaciones, S.L.
    >
    >

    S. Justin Gengo Guest

  4. #3

    Default Re: Threading and Session Objects

    I just readed this article but, what i need is to access to the session
    object from within a class. And doing it I alwais receive an error.


    "S. Justin Gengo" <sjgengo@aboutfortunate.com> escribió en el mensaje
    news:#m8a6gpWDHA.2040@TK2MSFTNGP11.phx.gbl...
    > Here's an article:
    >
    > [url]http://www.ftponline.com/vsm/2002_11/magazine/features/chester/[/url]
    >
    > --
    > S. Justin Gengo, MCP
    > Web Developer
    >
    > Free code library at:
    > [url]www.aboutfortunate.com[/url]
    >
    > "Out of chaos comes order."
    > Nietzche
    > "Roberto López" <rlopez@eurosistemas.net> wrote in message
    > news:%23Ww7zVpWDHA.2032@TK2MSFTNGP11.phx.gbl...
    > > Hi,
    > > I´m doing an asp.net application that uploads and downloads files and
    > > folders between the client and the server on my intranet. To do this I
    > have
    > > create threads and it runs Ok but I need to show to the user the
    progress
    > of
    > > the operation and here is the problem. I try to access to the Session
    > > Variables from inside the thread to show it on a page that automatically
    > > refresh, BUT, I have discovered that there is no access to the
    httpcontext
    > > from inside the new thread. Is there any other way to do this??
    > >
    > > Thanks a lot.
    > >
    > > --
    > > Roberto López
    > > Dpto. Soporte Software
    > > Eurosistemas Informáticos y Comunicaciones, S.L.
    > >
    > >
    >
    >

    Roberto López Guest

  5. #4

    Default Re: Threading and Session Objects

    The same error appears. For some reason, when the new thread is started from
    a class, the httpcontext is set to null to the thread. If it is done from a
    aspx page there is no error. Why? I don´t know.


    "S. Justin Gengo" <sjgengo@aboutfortunate.com> escribió en el mensaje
    news:#vEL9GqWDHA.536@TK2MSFTNGP10.phx.gbl...
    > How about passing the session object into the class through a public
    > property?
    >
    > --
    > S. Justin Gengo, MCP
    > Web Developer
    >
    > Free code library at:
    > [url]www.aboutfortunate.com[/url]
    >
    > "Out of chaos comes order."
    > Nietzche
    > "Roberto López" <rlopez@eurosistemas.net> wrote in message
    > news:OwpoO%23pWDHA.1640@TK2MSFTNGP10.phx.gbl...
    > > I just readed this article but, what i need is to access to the session
    > > object from within a class. And doing it I alwais receive an error.
    > >
    > >
    > > "S. Justin Gengo" <sjgengo@aboutfortunate.com> escribió en el mensaje
    > > news:#m8a6gpWDHA.2040@TK2MSFTNGP11.phx.gbl...
    > > > Here's an article:
    > > >
    > > > [url]http://www.ftponline.com/vsm/2002_11/magazine/features/chester/[/url]
    > > >
    > > > --
    > > > S. Justin Gengo, MCP
    > > > Web Developer
    > > >
    > > > Free code library at:
    > > > [url]www.aboutfortunate.com[/url]
    > > >
    > > > "Out of chaos comes order."
    > > > Nietzche
    > > > "Roberto López" <rlopez@eurosistemas.net> wrote in message
    > > > news:%23Ww7zVpWDHA.2032@TK2MSFTNGP11.phx.gbl...
    > > > > Hi,
    > > > > I´m doing an asp.net application that uploads and downloads files
    and
    > > > > folders between the client and the server on my intranet. To do this
    I
    > > > have
    > > > > create threads and it runs Ok but I need to show to the user the
    > > progress
    > > > of
    > > > > the operation and here is the problem. I try to access to the
    Session
    > > > > Variables from inside the thread to show it on a page that
    > automatically
    > > > > refresh, BUT, I have discovered that there is no access to the
    > > httpcontext
    > > > > from inside the new thread. Is there any other way to do this??
    > > > >
    > > > > Thanks a lot.
    > > > >
    > > > > --
    > > > > Roberto López
    > > > > Dpto. Soporte Software
    > > > > Eurosistemas Informáticos y Comunicaciones, S.L.
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Roberto López Guest

  6. #5

    Default Re: Threading and Session Objects

    I have tryed it too. :-(


    "John Saunders" <john.saunders@surfcontrol.com> escribió en el mensaje
    news:uneo$gqWDHA.2064@TK2MSFTNGP11.phx.gbl...
    > Try HttpContext.Current.Session.
    > --
    > John Saunders
    > Internet Engineer
    > [email]john.saunders@surfcontrol.com[/email]
    >
    > "Roberto López" <rlopez@eurosistemas.net> wrote in message
    > news:OwpoO%23pWDHA.1640@TK2MSFTNGP10.phx.gbl...
    > > I just readed this article but, what i need is to access to the session
    > > object from within a class. And doing it I alwais receive an error.
    > >
    > >
    > > "S. Justin Gengo" <sjgengo@aboutfortunate.com> escribió en el mensaje
    > > news:#m8a6gpWDHA.2040@TK2MSFTNGP11.phx.gbl...
    > > > Here's an article:
    > > >
    > > > [url]http://www.ftponline.com/vsm/2002_11/magazine/features/chester/[/url]
    > > >
    > > > --
    > > > S. Justin Gengo, MCP
    > > > Web Developer
    > > >
    > > > Free code library at:
    > > > [url]www.aboutfortunate.com[/url]
    > > >
    > > > "Out of chaos comes order."
    > > > Nietzche
    > > > "Roberto López" <rlopez@eurosistemas.net> wrote in message
    > > > news:%23Ww7zVpWDHA.2032@TK2MSFTNGP11.phx.gbl...
    > > > > Hi,
    > > > > I´m doing an asp.net application that uploads and downloads files
    and
    > > > > folders between the client and the server on my intranet. To do this
    I
    > > > have
    > > > > create threads and it runs Ok but I need to show to the user the
    > > progress
    > > > of
    > > > > the operation and here is the problem. I try to access to the
    Session
    > > > > Variables from inside the thread to show it on a page that
    > automatically
    > > > > refresh, BUT, I have discovered that there is no access to the
    > > httpcontext
    > > > > from inside the new thread. Is there any other way to do this??
    > > > >
    > > > > Thanks a lot.
    > > > >
    > > > > --
    > > > > Roberto López
    > > > > Dpto. Soporte Software
    > > > > Eurosistemas Informáticos y Comunicaciones, S.L.
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Roberto López Guest

  7. #6

    Default Re: Threading and Session Objects

    Perhaps you could supply a reproducer? I don't immediately see why there
    would be a problem passing Page.Context to the new thread before it starts.
    In particular, I can't imagine how, if you passed a non-null HttpContext
    into the thread, it would become null. I can understand how it could become
    invalid, but not how it could become null.
    --
    John Saunders
    Internet Engineer
    [email]john.saunders@surfcontrol.com[/email]

    "Roberto López" <rlopez@eurosistemas.net> wrote in message
    news:eHD7uoqWDHA.2100@TK2MSFTNGP11.phx.gbl...
    > I have tryed it too. :-(
    >
    >
    > "John Saunders" <john.saunders@surfcontrol.com> escribió en el mensaje
    > news:uneo$gqWDHA.2064@TK2MSFTNGP11.phx.gbl...
    > > Try HttpContext.Current.Session.
    > > --
    > > John Saunders
    > > Internet Engineer
    > > [email]john.saunders@surfcontrol.com[/email]
    > >
    > > "Roberto López" <rlopez@eurosistemas.net> wrote in message
    > > news:OwpoO%23pWDHA.1640@TK2MSFTNGP10.phx.gbl...
    > > > I just readed this article but, what i need is to access to the
    session
    > > > object from within a class. And doing it I alwais receive an error.
    > > >
    > > >
    > > > "S. Justin Gengo" <sjgengo@aboutfortunate.com> escribió en el mensaje
    > > > news:#m8a6gpWDHA.2040@TK2MSFTNGP11.phx.gbl...
    > > > > Here's an article:
    > > > >
    > > > > [url]http://www.ftponline.com/vsm/2002_11/magazine/features/chester/[/url]
    > > > >
    > > > > --
    > > > > S. Justin Gengo, MCP
    > > > > Web Developer
    > > > >
    > > > > Free code library at:
    > > > > [url]www.aboutfortunate.com[/url]
    > > > >
    > > > > "Out of chaos comes order."
    > > > > Nietzche
    > > > > "Roberto López" <rlopez@eurosistemas.net> wrote in message
    > > > > news:%23Ww7zVpWDHA.2032@TK2MSFTNGP11.phx.gbl...
    > > > > > Hi,
    > > > > > I´m doing an asp.net application that uploads and downloads files
    > and
    > > > > > folders between the client and the server on my intranet. To do
    this
    > I
    > > > > have
    > > > > > create threads and it runs Ok but I need to show to the user the
    > > > progress
    > > > > of
    > > > > > the operation and here is the problem. I try to access to the
    > Session
    > > > > > Variables from inside the thread to show it on a page that
    > > automatically
    > > > > > refresh, BUT, I have discovered that there is no access to the
    > > > httpcontext
    > > > > > from inside the new thread. Is there any other way to do this??
    > > > > >
    > > > > > Thanks a lot.
    > > > > >
    > > > > > --
    > > > > > Roberto López
    > > > > > Dpto. Soporte Software
    > > > > > Eurosistemas Informáticos y Comunicaciones, S.L.
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    John Saunders Guest

  8. #7

    Default Re: Threading and Session Objects

    The problem is that I not only need to read values from session variables,
    i need to update session variables while the new thread is running, and here
    is the problem. When i try to set a new value to a session variable I
    receive
    the error of HttpContext is a Null Reference.
    I need to store a value into the session variable to read it periodically
    from other
    page to know about the status of the process. I hope you understand me.

    My code is like this:

    public class AccessIO

    public sub New()

    end sub

    public sub CopyFiles()
    ...routine to copy files...
    ...... ..... ... ..


    ...here is the error...
    httpcontext.current.session("PercentComplete") = anyvalue

    end sub

    end class


    "John Saunders" <john.saunders@surfcontrol.com> escribió en el mensaje
    news:Ogl801qWDHA.1644@TK2MSFTNGP10.phx.gbl...
    > Perhaps you could supply a reproducer? I don't immediately see why there
    > would be a problem passing Page.Context to the new thread before it
    starts.
    > In particular, I can't imagine how, if you passed a non-null HttpContext
    > into the thread, it would become null. I can understand how it could
    become
    > invalid, but not how it could become null.
    > --
    > John Saunders
    > Internet Engineer
    > [email]john.saunders@surfcontrol.com[/email]
    >
    > "Roberto López" <rlopez@eurosistemas.net> wrote in message
    > news:eHD7uoqWDHA.2100@TK2MSFTNGP11.phx.gbl...
    > > I have tryed it too. :-(
    > >
    > >
    > > "John Saunders" <john.saunders@surfcontrol.com> escribió en el mensaje
    > > news:uneo$gqWDHA.2064@TK2MSFTNGP11.phx.gbl...
    > > > Try HttpContext.Current.Session.
    > > > --
    > > > John Saunders
    > > > Internet Engineer
    > > > [email]john.saunders@surfcontrol.com[/email]
    > > >
    > > > "Roberto López" <rlopez@eurosistemas.net> wrote in message
    > > > news:OwpoO%23pWDHA.1640@TK2MSFTNGP10.phx.gbl...
    > > > > I just readed this article but, what i need is to access to the
    > session
    > > > > object from within a class. And doing it I alwais receive an error.
    > > > >
    > > > >
    > > > > "S. Justin Gengo" <sjgengo@aboutfortunate.com> escribió en el
    mensaje
    > > > > news:#m8a6gpWDHA.2040@TK2MSFTNGP11.phx.gbl...
    > > > > > Here's an article:
    > > > > >
    > > > > > [url]http://www.ftponline.com/vsm/2002_11/magazine/features/chester/[/url]
    > > > > >
    > > > > > --
    > > > > > S. Justin Gengo, MCP
    > > > > > Web Developer
    > > > > >
    > > > > > Free code library at:
    > > > > > [url]www.aboutfortunate.com[/url]
    > > > > >
    > > > > > "Out of chaos comes order."
    > > > > > Nietzche
    > > > > > "Roberto López" <rlopez@eurosistemas.net> wrote in message
    > > > > > news:%23Ww7zVpWDHA.2032@TK2MSFTNGP11.phx.gbl...
    > > > > > > Hi,
    > > > > > > I´m doing an asp.net application that uploads and downloads
    files
    > > and
    > > > > > > folders between the client and the server on my intranet. To do
    > this
    > > I
    > > > > > have
    > > > > > > create threads and it runs Ok but I need to show to the user the
    > > > > progress
    > > > > > of
    > > > > > > the operation and here is the problem. I try to access to the
    > > Session
    > > > > > > Variables from inside the thread to show it on a page that
    > > > automatically
    > > > > > > refresh, BUT, I have discovered that there is no access to the
    > > > > httpcontext
    > > > > > > from inside the new thread. Is there any other way to do this??
    > > > > > >
    > > > > > > Thanks a lot.
    > > > > > >
    > > > > > > --
    > > > > > > Roberto López
    > > > > > > Dpto. Soporte Software
    > > > > > > Eurosistemas Informáticos y Comunicaciones, S.L.
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Roberto López Guest

  9. #8

    Default Re: Threading and Session Objects

    Roberto, don't do that.

    Instead, house your thread in a separate class. Give that class a private
    member variable of type HttpContext, say, m_Context. Write a public property
    of type HttpContext say, TheContext.

    To use the thread, create an instance of the thread class. Then use that
    instance to set the property:

    myThread.TheContext = Page.Context

    Then start the thread. The thread can then access m_Context instead of
    HttpContext.Current.

    --
    John Saunders
    Internet Engineer
    [email]john.saunders@surfcontrol.com[/email]

    "Roberto López" <rlopez@eurosistemas.net> wrote in message
    news:O3LPLErWDHA.2268@TK2MSFTNGP11.phx.gbl...
    > The problem is that I not only need to read values from session variables,
    > i need to update session variables while the new thread is running, and
    here
    > is the problem. When i try to set a new value to a session variable I
    > receive
    > the error of HttpContext is a Null Reference.
    > I need to store a value into the session variable to read it periodically
    > from other
    > page to know about the status of the process. I hope you understand me.
    >
    > My code is like this:
    >
    > public class AccessIO
    >
    > public sub New()
    >
    > end sub
    >
    > public sub CopyFiles()
    > ...routine to copy files...
    > ...... ..... ... ..
    >
    >
    > ...here is the error...
    > httpcontext.current.session("PercentComplete") = anyvalue
    >
    > end sub
    >
    > end class
    >
    >
    > "John Saunders" <john.saunders@surfcontrol.com> escribió en el mensaje
    > news:Ogl801qWDHA.1644@TK2MSFTNGP10.phx.gbl...
    > > Perhaps you could supply a reproducer? I don't immediately see why there
    > > would be a problem passing Page.Context to the new thread before it
    > starts.
    > > In particular, I can't imagine how, if you passed a non-null HttpContext
    > > into the thread, it would become null. I can understand how it could
    > become
    > > invalid, but not how it could become null.
    > > --
    > > John Saunders
    > > Internet Engineer
    > > [email]john.saunders@surfcontrol.com[/email]
    > >
    > > "Roberto López" <rlopez@eurosistemas.net> wrote in message
    > > news:eHD7uoqWDHA.2100@TK2MSFTNGP11.phx.gbl...
    > > > I have tryed it too. :-(
    > > >
    > > >
    > > > "John Saunders" <john.saunders@surfcontrol.com> escribió en el mensaje
    > > > news:uneo$gqWDHA.2064@TK2MSFTNGP11.phx.gbl...
    > > > > Try HttpContext.Current.Session.
    > > > > --
    > > > > John Saunders
    > > > > Internet Engineer
    > > > > [email]john.saunders@surfcontrol.com[/email]
    > > > >
    > > > > "Roberto López" <rlopez@eurosistemas.net> wrote in message
    > > > > news:OwpoO%23pWDHA.1640@TK2MSFTNGP10.phx.gbl...
    > > > > > I just readed this article but, what i need is to access to the
    > > session
    > > > > > object from within a class. And doing it I alwais receive an
    error.
    > > > > >
    > > > > >
    > > > > > "S. Justin Gengo" <sjgengo@aboutfortunate.com> escribió en el
    > mensaje
    > > > > > news:#m8a6gpWDHA.2040@TK2MSFTNGP11.phx.gbl...
    > > > > > > Here's an article:
    > > > > > >
    > > > > > > [url]http://www.ftponline.com/vsm/2002_11/magazine/features/chester/[/url]
    > > > > > >
    > > > > > > --
    > > > > > > S. Justin Gengo, MCP
    > > > > > > Web Developer
    > > > > > >
    > > > > > > Free code library at:
    > > > > > > [url]www.aboutfortunate.com[/url]
    > > > > > >
    > > > > > > "Out of chaos comes order."
    > > > > > > Nietzche
    > > > > > > "Roberto López" <rlopez@eurosistemas.net> wrote in message
    > > > > > > news:%23Ww7zVpWDHA.2032@TK2MSFTNGP11.phx.gbl...
    > > > > > > > Hi,
    > > > > > > > I´m doing an asp.net application that uploads and downloads
    > files
    > > > and
    > > > > > > > folders between the client and the server on my intranet. To
    do
    > > this
    > > > I
    > > > > > > have
    > > > > > > > create threads and it runs Ok but I need to show to the user
    the
    > > > > > progress
    > > > > > > of
    > > > > > > > the operation and here is the problem. I try to access to the
    > > > Session
    > > > > > > > Variables from inside the thread to show it on a page that
    > > > > automatically
    > > > > > > > refresh, BUT, I have discovered that there is no access to the
    > > > > > httpcontext
    > > > > > > > from inside the new thread. Is there any other way to do
    this??
    > > > > > > >
    > > > > > > > Thanks a lot.
    > > > > > > >
    > > > > > > > --
    > > > > > > > Roberto López
    > > > > > > > Dpto. Soporte Software
    > > > > > > > Eurosistemas Informáticos y Comunicaciones, S.L.
    > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    John Saunders Guest

  10. #9

    Default Re: Threading and Session Objects

    Although I don't know what will the performance impact be, but I think
    this should work:

    In your main thread, the thread have valid permission to access/modify
    Session, you can process the events raised by the threads and do
    Invokes inside the handlers, then you can do what ever you want.

    Therefore, create some events for the theads (I assume you use a class
    to wrap the thread function).

    Hope it helps,
    Homa Wong

    "Roberto López" <rlopez@eurosistemas.net> wrote in message news:<O3LPLErWDHA.2268@TK2MSFTNGP11.phx.gbl>...
    > The problem is that I not only need to read values from session variables,
    > i need to update session variables while the new thread is running, and here
    > is the problem. When i try to set a new value to a session variable I
    > receive
    > the error of HttpContext is a Null Reference.
    > I need to store a value into the session variable to read it periodically
    > from other
    > page to know about the status of the process. I hope you understand me.
    >
    > My code is like this:
    >
    > public class AccessIO
    >
    > public sub New()
    >
    > end sub
    >
    > public sub CopyFiles()
    > ...routine to copy files...
    > ...... ..... ... ..
    >
    >
    > ...here is the error...
    > httpcontext.current.session("PercentComplete") = anyvalue
    >
    > end sub
    >
    > end class
    >
    >
    > "John Saunders" <john.saunders@surfcontrol.com> escribió en el mensaje
    > news:Ogl801qWDHA.1644@TK2MSFTNGP10.phx.gbl...
    > > Perhaps you could supply a reproducer? I don't immediately see why there
    > > would be a problem passing Page.Context to the new thread before it
    > starts.
    > > In particular, I can't imagine how, if you passed a non-null HttpContext
    > > into the thread, it would become null. I can understand how it could
    > become
    > > invalid, but not how it could become null.
    > > --
    > > John Saunders
    > > Internet Engineer
    > > [email]john.saunders@surfcontrol.com[/email]
    > >
    > > "Roberto López" <rlopez@eurosistemas.net> wrote in message
    > > news:eHD7uoqWDHA.2100@TK2MSFTNGP11.phx.gbl...
    > > > I have tryed it too. :-(
    > > >
    > > >
    > > > "John Saunders" <john.saunders@surfcontrol.com> escribió en el mensaje
    > > > news:uneo$gqWDHA.2064@TK2MSFTNGP11.phx.gbl...
    > > > > Try HttpContext.Current.Session.
    > > > > --
    > > > > John Saunders
    > > > > Internet Engineer
    > > > > [email]john.saunders@surfcontrol.com[/email]
    > > > >
    > > > > "Roberto López" <rlopez@eurosistemas.net> wrote in message
    > > > > news:OwpoO%23pWDHA.1640@TK2MSFTNGP10.phx.gbl...
    > > > > > I just readed this article but, what i need is to access to the
    > session
    > > > > > object from within a class. And doing it I alwais receive an error.
    > > > > >
    > > > > >
    > > > > > "S. Justin Gengo" <sjgengo@aboutfortunate.com> escribió en el
    > mensaje
    > > > > > news:#m8a6gpWDHA.2040@TK2MSFTNGP11.phx.gbl...
    > > > > > > Here's an article:
    > > > > > >
    > > > > > > [url]http://www.ftponline.com/vsm/2002_11/magazine/features/chester/[/url]
    > > > > > >
    > > > > > > --
    > > > > > > S. Justin Gengo, MCP
    > > > > > > Web Developer
    > > > > > >
    > > > > > > Free code library at:
    > > > > > > [url]www.aboutfortunate.com[/url]
    > > > > > >
    > > > > > > "Out of chaos comes order."
    > > > > > > Nietzche
    > > > > > > "Roberto López" <rlopez@eurosistemas.net> wrote in message
    > > > > > > news:%23Ww7zVpWDHA.2032@TK2MSFTNGP11.phx.gbl...
    > > > > > > > Hi,
    > > > > > > > I´m doing an asp.net application that uploads and downloads
    > files
    > and
    > > > > > > > folders between the client and the server on my intranet. To do
    > this
    > I
    > have
    > > > > > > > create threads and it runs Ok but I need to show to the user the
    > progress
    > of
    > > > > > > > the operation and here is the problem. I try to access to the
    > Session
    > > > > > > > Variables from inside the thread to show it on a page that
    > automatically
    > > > > > > > refresh, BUT, I have discovered that there is no access to the
    > httpcontext
    > > > > > > > from inside the new thread. Is there any other way to do this??
    > > > > > > >
    > > > > > > > Thanks a lot.
    > > > > > > >
    > > > > > > > --
    > > > > > > > Roberto López
    > > > > > > > Dpto. Soporte Software
    > > > > > > > Eurosistemas Informáticos y Comunicaciones, S.L.
    > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    Homa Guest

  11. #10

    Default Re: Threading and Session Objects

    Hi,

    Pass the session as a parameter to the thread (works like charm). This
    link contain example :

    [url]http://www.developersdex.com/gurus/code/662.asp[/url]

    Natty Gur, CTO
    Dao2Com Ltd.
    34th Elkalay st. Raanana
    Israel , 43000
    Phone Numbers:
    Office: +972-(0)9-7740261
    Fax: +972-(0)9-7740261
    Mobile: +972-(0)58-888377


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur Guest

  12. #11

    Default Re: Threading and Session Objects

    I don´t understand clearly the code you write, but, with this, can I write
    new values in session variables and these are readable from other page while
    the thread is running?


    "Natty Gur" <natty@dao2com.com> escribió en el mensaje
    news:OZbn9RxWDHA.3924@tk2msftngp13.phx.gbl...
    > Hi,
    >
    > Pass the session as a parameter to the thread (works like charm). This
    > link contain example :
    >
    > [url]http://www.developersdex.com/gurus/code/662.asp[/url]
    >
    > Natty Gur, CTO
    > Dao2Com Ltd.
    > 34th Elkalay st. Raanana
    > Israel , 43000
    > Phone Numbers:
    > Office: +972-(0)9-7740261
    > Fax: +972-(0)9-7740261
    > Mobile: +972-(0)58-888377
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Roberto López Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139