As soon as you return to the client the context is gone
Can you respond to the client then make the client automatically check back
( Meta Tag or Java Script ) to see if it gets authenticated or not.

when waiting for the Read Event your are blocking ??!!!!!!!!! but not
requests??

Intersting problem. I like to see what is the solution for this

"mazza" <mazza@doobry.com> wrote in message
news:%23sHpmMGXDHA.1888@TK2MSFTNGP10.phx.gbl...
> I'm new to ASP.NET...
> I'm getting the error "Response is not available in this context" in
> my application.
> The circumstances are:
> - I display a username/password login page (login.aspx) for the user
> to login.
> - When I get the user's request (Submit button event handler), I use a
> third-party TCP/IP socket component to perform a non-blocking
> (asyncronous) connect to an embedded device and return from the Submit
> event handler.
> - I'm using asynshronous events provided by the socket component to
> determine when I'm connected to the device. When connected, I send a
> small packet and wait for a Read event; now in the Read event of the
> socket component, based on the embedded device's response, I determine
> if it is ok to allow the browser user to "login" to the device or
> not -- on success, I'm attempting to redirect the browser to my
> opening page (say index.aspx), using...
>
> Response.Redirect("index.aspx")
>
> ... however, this gives me the "Response is not available in this
> context" error.
>
> What am I doing wrong? Is the context object null'd after I exit from
> my Submit_Click event handler and therefore I cannot talk back to the
> browser at a later point from the TCP/IP socket component's Read event
> handler?
> If this is the case, is it ok for me to spin off a thread to handle
> the current request and perform my TCP/IP activity with the device -
> would I have access to the context (and response object) then? Or do I
> need to make everything blocking before I return from my Submit event
> handler and execute everything from the context of that same request
> thread?
>
> Any help will be much appreciated.
>
> Thanks!
>
>