session vs caching vs control state vs view state
difference between session and cache and view state and control state
which is used at what time and for what purpose exactly
Hi,this article explains it the best: ASP.NET: Nine Options for Managing Persistent User State in Your ASP.NET Application.Grz, Kris. Read my blog. Handy Firefox plugins for web developers.Workaround for non working Mark as answer buttons....Session variables vs. Session States
What is the difference and in what situations are they used.
A session state (the state of your session) holds your session variables. If your session state expires (due to inactivity) then you lose your session variables...and any other info stored for that session.
If you need to store USER specific information within a web app, then session variables are one(of several) ways to do it.
Is there any code that you could show that would give an example?
example of what? reading and writing session variables?
...Viewstate vs. Session State vs. Caching
I need to save state data between postbacks on a page. This data will only be used by this page. Am I correct that if I need to save simple data types (ints, strings...) that I would be better off using ViewState instead of Sessions or using Cache? Can more complicated datatypes (entity objects) be saved in ViewState? If so, how?
Read this: http://www.thedatafarm.com/blog/2007/09/03/EntityKeyAndASPNETViewState.aspx
Remember, the more you put in the viewstate the more you are affecting your page's performance(http://msdn2.microsoft.com/en-us/library/...Viewstate vs Session Variables...
I'm a bit confused about when I should use a Viewstate variable, and when I should use a Session Variable. Some explanation of when to use one over the other would be helpful.
Say I wanted to build a simple page that has a counter. Everytime you click a button, the page adds one to the counter and displays it on the page. I could accomplish the same thing with a Viewstate variable, or a Session Variable. So which should I use, and why?
Use viewstate when you need to preserve data for the postbacks. Use session to persist data for the user session.
ViewS...Session State vs ViewState
I know that I have been burned in the past using Sessions classic ASP (not closing, memeory leak, etc). However I heard in asp.net sessions have change dramatically. Scenario: I want to build a midsize to large web app using asp.net 2.0, having a login area where once a user logins...they would carry a GUID......in the admin area...as well as the front facing web app. The user would need a High Time Out Set Though....... After reading some post I know I can do it a couple different way...but it seems that session would be the easiest...I also heard that I could pass view state into session ...ViewState vs Session variables
AM developing a multiuser web application and I need to get one thing clear.
I need to restore values between postback and am wondering wether or not to use viewstate or session variables. If a user saves a value in a viewstate is that available to other users and in my application I do not wish to do that.
Should I use session or viewstate variables??
Thanks for your advice
Go thru following sites it's useful.
Values stored in viewstate can't be spanned across the page..it works only within the same page.
values stored in ViewState is available to tht user only.
...Viewstate vs Session Variables
I'm writing an application where I need to be able to track certain info about a user, and even end the app after a period of inactivity.
It's pretty sensitive information, so I need it to be as secure as possible.
Should I be using Viewstate or Session to persist this state info?
Viewstate provides no security.Mike Banavige~~~~~~~~~~~~Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/
The ViewState does provide some basic protection in ASP.NET 2.0. It can be turned off, but by default it is o...Session vs Cookie State management
I have always been confused by this, even when I use PHP. Session & Cookies are two most common State management techniques.Sessions last until browser is closed, and Cookies persist beyond that. All that's fine.But I have also heard of permanent vs temporary cookies. And I have also read that a browser not set to accept cookies at all, cannot be tracked using sessions. All this has led me to conclude that temporary cookies are managed in memory & are the way sessions are managed. When the browser is closed, in memory-cookies are lost, and thus the sessions is over.And cook...Issue using control created in VS.net 2003 in VS.net 2002
I have a friend that has an issue using my asp.net C# custom control in Visual Studio.net 2002 that I have compiled under Visual Studio.net 2003. I never did test it with that version, but I was under the impression that it should still work as long as you don't use any features specific to the 1.1 framework (which I really don't think I did). My guess now is that this is correct, but only when using 2002 controls in 2003. I have searched the web, these forums, and MSDN for the last 30 minutes with no real answer. The guy that runs MetaBuilders (http://www.metabuilders.com/Faq.aspx) tell...Session State in VS.Net
I have an ASP background with very little VB. I'm trying to integrate a transactional app into DotNetNuke. The trans app uses session state to verify userid. I dont want to change all the code in the trans. app so I thought updating the following code to include Session("UID") = userId in signin.ascs.vb would do the trick but it doesnt appear to be storing the userid into state. Does anyone know what the problem might be ?
If blnLogin Then
' Attempt to Validate User Credentials
Dim userId As Integer = objSecurity.UserLogin(txtUsername.Text, txtPassword.Text, _p...Alternative for Viewstate to store Dataset? + State management
In my application, we are handling dataset/datatable to enable the gridview paging/sorting functionality. hence the dataset/datatabel object are stored in Viewstate to avoid the DB call on every page click or sorting. Now the problem is viewstate size, because in my application we may have more than one gridview so that the datset size also increased and viewstate size also increased to 1 MB.
1. How to reduce the viewstate size? or What is gobal norms for Vie...State management upon session variable changes
I noticed that whenever a session variable is changed...the application knows about it and suddenly restarts session.
My question is does restart "ALL" sessions or only the active sessions for which the variables changed?
Imagine a "multi-user" application all with different states and an administration panel that lets you change session variables. In this case, my question has to do with the question that if Company X changes his session variables, will only Company X's sessions be reset or will all "sessions" be reset? Hope that makes sense.
I am working on my first ever custom control. I am starting with a
ConfirmationButton control, a button control that will pop up a confirm
message before submitting the form.
There are lot of examples online for building this control. I see that
there are two places where you can save the confirm message string. Can
any one tell me what's the difference between the two? Why use
viewstate when we can avoid it? Is there any downside to using the
private string variable?
**************** METHOD 1******************
private string confirmmessage;
public string C...ViewState vs. Session vs. Cache
I'm working with C#, VS2005, and ASP.Net 2.0. I've been reading a lot about State Management but am getting conflicting advice, dependent on version, etc. So I thought I'd post my assumptions here and feedback from the experts on here. For my environment, would this be correct: Object Scope Max. Data SizeViewState Page &n...