Opinions on Viewstate vs. Session variable for state management on dataset

I came across many sample codes that using ViewState(myDataSet) and Session("myDataSet").  Which is a better way to use to keep the session around.  What are the pros and cons?  Anybody can share with your experience or thoughts?

Thanks,
teresa
0
tmccuan2
5/27/2004 7:12:11 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
829 Views

Similar Articles

[PageSpeed] 48

Take a loot at this article:

State Management in Web Forms
http://www.c-sharpcorner.com/Code/2004/Feb/StateManagementInWebForms.asp
Darrell Norton, MVP
Darrell Norton's Blog


Please mark this post as answered if it helped you!
0
DarrellNorton
5/27/2004 8:24:17 PM
Reply:

Similar Artilces:

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. Thanks, Mattypee 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. MajorCatsMajorCats Is there any code that you could show that would give an example? Thanks, Mattypee 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? Thanks Hi, 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. An example: 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? Thanks! 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
Hi, 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
Hello there. 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? thanks.   dd 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
Hi.. 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
Hi,         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. ...

Control property
Hi, 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? Thanks. **************** 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...

Web resources about - Opinions on Viewstate vs. Session variable for state management on dataset - asp.net.presentation-controls

Management - Wikipedia, the free encyclopedia
Management in business and organizations is the function that coordinates the efforts of people to accomplish goals and objectives using available ...

Management - Wikipedia, the free encyclopedia
Management in businesses and organizations is the function that coordinates the efforts of people to accomplish goals and objectives by using ...

Management - Wikipedia, the free encyclopedia
Management in business and organizations is an art that coordinates the efforts of people to accomplish goals and objectives using available ...

Management - Wikipedia, the free encyclopedia
Management in business and organizations is the function that coordinates the efforts of people to accomplish goals and objectives using available ...

Australian public service failing to share information: Public Sector Data Management report
Agencies spending years to agree to share a few tables of data. Two agencies needed 11 agreements to share information.

Coke Shuffles Management in Wake of Wendy Clark Exit
Coca-Cola is making significant changes to its North American leadership team in the wake of the departure of Wendy Clark, a highly respected ...

Major Takata investor dumps stock due to management concerns
... Earnings/Financials , Safety , Japan One of Takata's largest investors sold off its shares after losing confidence in the company's management ...

What's the most popular IT asset management software?
IT asset management (ITAM) software manages the lifecycle of hardware and software. It can help influence decisions about which assets need to ...

Get trained for a career in project management for $39
... can be daunting—and expensive, when you’re starting your training from scratch. So if you’ve been thinking about a new career in project management, ...

Charlie Sheen Plans To Counter Sue Ex-Fiancee In HIV Lawsuit Involving ‘Anger Management’ Profits
From the moment the Anger Management actor made public on The Today Show on November 17 that he has been HIV Positive for at least 4-years, we ...

Resources last updated: 12/9/2015 10:32:04 PM