Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:
Donate to VoyForums (PayPal):
[ Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: [1] ] |
Subject: ASP.Net cookies vs HttpContext (Context.Items.Add()) | |
Author: Jose Varghese [ Edit | View ] |
Date Posted: 02:51:41 05/20/05 Fri ASP.Net Cookies Vs HttpContext HttpContext is normally used when data is needed in memory only at the moment of page transfer. This is the state that lives in HttpContext.Items, which only lasts for the duration of the current request, hence its characteristic of "transient". It's quickly discarded as soon as the current request has finished processing, so it doesn't impose any of the drawbacks you need to care about with Session. So it is better to use HttpContext than cookies to store inter-page state. Cookies are a bad choice for storing state. But HttpContext will only work in conjunction with Server.Transfer. It will not work using Response.Redirect. The reason why it will not work with Response.Redirect is because Redirect results in another round trip to the client which results in a new HTTP Request and thus a new HTTPContext. As regards to size of data HttpContext does support more size than cookies. Currently each cookie is limited to a size of 4096 bytes. Context objects allows you the flexibility to pass any kind of object from simple text to heavy objects like dataset which one cant do with cookies. Infact most of the limitations of cookies don't apply to HttpContext. As regards to performance HttpContext does not make any problem since the request last only for the duration of the current request i.e till the time the next page is loaded. After that the object is no longer accessible and eliminates the cleaning code required in next page like the way it is required in Session. Adding Items to Context ----------------------- Context.Items.Add("UserId", txtUserId.Text); Retrieving Items from Context ----------------------------- txtUserId.Text = Context.Items["UserId"]; |
Subject: Bug with Dot Net Winforms (Shortcut Key) | |
Author: Jose Varghese [ Edit | View ] |
Date Posted: 07:56:23 08/03/04 Tue There is a bug with Dot Net Winforms. The shortcut key given from one winform is invoking the button on another winform. I reported the same to MSDN and after one month got the reply that 'it has been fixed and will be available in next version'. Till then, u have to search for alternate solutions! http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=509a4eef-f33d-4e32-b6c2-651220d58156 |
[ Main index ] [ Archives: [1] ] |
Forum timezone: GMT-8 VF Version: 3.00b, ConfDB: Before posting please read our privacy policy. VoyForums(tm) is a Free Service from Voyager Info-Systems. Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved. |