Solved

How to manage page data without using viewstate in asp.net page

Posted on 2009-05-06
4
264 Views
Last Modified: 2013-12-17
Hi experts,

I have problem with viewstates in asp.net pages.My client is having week internet connection.Due to huge viewstate the page is taking too much time for loading from server. I have grid control on my pages which are actually creating huge viewstate for page.

Can i remove all the viewstate from the page and move it to session to store the data of controls in it. My control on pages are also having event associated with them speciall the grid control having "row bound event"

I am not aware of how it can be done and handled.

Can any one please provide me a solution to it?

Its very urgent.
0
Comment
Question by:winjittechnologies
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
GuitarRich earned 250 total points
Comment Utility
Have a look at this - you can store the viewstate in the session which will reduce the size of the pages:
http://www.hanselman.com/blog/MovingViewStateToTheSessionObjectAndMoreWrongheadedness.aspx
 
0
 
LVL 13

Expert Comment

by:copyPasteGhost
Comment Utility
Is the view state absolutly necessary for the whole page? you can just disable the viewstate on some controls that will make your page smaller.

Ghost
0
 
LVL 13

Assisted Solution

by:copyPasteGhost
copyPasteGhost earned 250 total points
Comment Utility
you can also Cache the data on the server using the Cache object.

or if you only need the data for one request you can use the

HttpContext.Current.Items["StoreStuff"] = "";
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now