michael_hk Posted January 28, 2005 Posted January 28, 2005 Hi guys, I am using the FrontController pattern and I have the following two aspx pages. Test1.aspx public class handler : IHttpHandler { public void ProcessRequest(HttpContext context) { ... context.Items["datatable"] = dt; context.Server.Transfer("Test2.aspx"); } } Test2.aspx DataTable dt2 = (DataTable)Context.Items["datatable"]; In Test1.aspx I assign a datatable (dt) to context and in Test2.aspx I can use Context to retrieve it. So is it context == Context? :confused: Thanks for your help. Michael Quote There is no spoon. <<The Matrix>>
Leaders dynamic_sysop Posted January 28, 2005 Leaders Posted January 28, 2005 Context.Items["datatable"] is an object , in this case a DataTable by the look of it , so you are casting the object to a DataTable. basically it's not context = context , it's context = datatable Quote
*Gurus* Derek Stone Posted January 28, 2005 *Gurus* Posted January 28, 2005 ProcessRequest is passed the HttpContext object for the current request. This is the same as using System.Web.HttpContext.Current. Pages also expose the context through the Context property. All three of these are the same exact object instance. Quote Posting Guidelines
michael_hk Posted January 29, 2005 Author Posted January 29, 2005 Thanks for all the explanation. Clear now. :D Quote There is no spoon. <<The Matrix>>
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.