Sharing session via web request
I have spend a lot of time on this problem without any change :
I have got 2 simples apsx page, in the first page the
Page_Load
event put data in the session
;
later the on_click event of a button fire an HttpWebRequest to the second page
with the idea to retrieve on the page_load of the second page the data in the session.
to sum up : 1st page put data in session, make the httpWebRequest to the 2nd page
2nd page : try to get 开发者_运维百科the stored data in the session.
This is the different attempt of code i 've tested to perform this action, the result was always the same. When i try to add sessionId Information (via a cookieContainer or directly in the Header request) i get a timeout exception System.Net.HttpWebRequest.GetResponse() and when i do the HttpWebrequest without the session_id information i get the response immediatly but without the session info :-)
It's not clear what you're trying to do, but have you considered using Server.Execute
instead?
http://www.west-wind.com/weblog/posts/2004/Jun/08/Capturing-Output-from-ASPNet-Pages
精彩评论