1) use webclient and pass along the session cookie and creditials to fetch
the page, then load into the xml document.
2) write the session to a global cache, then pass the cache key
public class SessionCache {
public static Hashtable Sessions[] = new Hashtable();
}
if (System.Web.HttpContext.Current.Session["user_id"] != null) {
string key = System.Guid.NewGuid().ToString();
lock(typeof(SessionCache)) {
SessionCache.Sessions.Add(key,System.Web.HttpConte xt.Current.Session["user_i
d"]) ;
}
XmlDocument d = new XmlDocument();
d.Load(new XmlTextReader("http://localhost/page.aspx?key=" + key));
lock(typeof(SessionCache)) {
SessionCache.Sessions.Remove(key);
}
}
in the calling page
lock(typeof(SessionCache)) {
HttpSessionState session = (HttpSessionState)
SessionCache.Sessions[Request.Form["key"]];
}
"Peter Theill" <as**@asdf.com> wrote in message
news:eH**************@TK2MSFTNGP09.phx.gbl...
Hi,
I'm trying to include the content of a request into an Xml document:
if (System.Web.HttpContext.Current.Session["user_id"] != null) {
XmlDocument d = new XmlDocument();
d.Load(new XmlTextReader("http://localhost/page.aspx"));
}
The requested page (page.aspx) is an XHTML page so I'm able to parse it as
a document. However if I want to use the current session in that request to
'page.aspx' how would I do that?
In "page.aspx" I reference a UserControl having this code line:
string userId =
(string)System.Web.HttpContext.Current.Session["user_id"];
It's empty even though I check for it (first linie) just before requesting
the page. Could anyone help?
// pt