473,507 Members | 2,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Save ViewState to server - deserialize is very slow

Can anyone tell me why when trying to use the following code to
deserialize the viewstate it takes a long time with a large viewstate.
This really surprised as the viewstate is big, but not that big. The
formatter.Deserialize method takes a couple seconds which is a long
time.

protected override object LoadPageStateFromPersistenceMedium()
{
object viewState;
string tempViewState;
tempViewState = (string)this.Cache["ViewState"];
LosFormatter formatter = new LosFormatter();
try
{
viewState = formatter.Deserialize(tempViewState);
}
catch(Exception x)
{
throw new HttpException ("Invalid viewstate:" + x.ToString());
}
return viewState;
}

Apr 25 '06 #1
2 1800
What are you storing in there, and what is the goal? Here's an article,
which also references some excellent work by Robert Boedigheimer, that covers
all this:

http://www.eggheadcafe.com/articles/20040613.asp

Peter

Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"mo******@gmail.com" wrote:
Can anyone tell me why when trying to use the following code to
deserialize the viewstate it takes a long time with a large viewstate.
This really surprised as the viewstate is big, but not that big. The
formatter.Deserialize method takes a couple seconds which is a long
time.

protected override object LoadPageStateFromPersistenceMedium()
{
object viewState;
string tempViewState;
tempViewState = (string)this.Cache["ViewState"];
LosFormatter formatter = new LosFormatter();
try
{
viewState = formatter.Deserialize(tempViewState);
}
catch(Exception x)
{
throw new HttpException ("Invalid viewstate:" + x.ToString());
}
return viewState;
}

Apr 25 '06 #2
Peter,

Thanks for the reply. I have seen this article and currently have my
solution working in a similer way. I am still wondering why the
Deserialize method is soo slow with a large viewstate. I would expect
that this would be handled a lot better.

Apr 25 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1417
by: Kikoz | last post by:
Hi all. I override Page's SavePageStateToPersistenceMedium(...) and LoadPageStateFromPersistenceMedium() methods to keep page's ViewState on the server. Very well documented approach, nothing...
6
6019
by: vinay | last post by:
What is this error?? Exception Details: System.Web.HttpException: Unable to validate data. System.Web.Configuration.MachineKey.GetDecodedData(Byte buf, Byte modifier, Int32 start, Int32...
0
1355
by: Ian Lane .enizin.net> | last post by:
Hello, I am having a very strange issue regarding our macintosh users running IE. For some reason some users running IE on the Mac are getting an invalid viewstate exception when first coming to...
7
3525
by: Ben Amada | last post by:
I've created a class that I need to store in ViewState. However when I try to store it in ViewState, I get the following error: "The type 'solution.pe2' must be marked as Serializable or have a...
5
3259
by: sjl | last post by:
I've got an .aspx webform for searching my database. It basically takes user input and passes it as a parm into a stored proc to search a table. The results are returned in a SQLDataReader and...
1
3025
by: Irene | last post by:
Hello all! I'm creating a web site in ASP.NET (VB.NET). One of the requirements was to allow users to create orders going through several steps. A must have is to have an option to save the work...
1
1336
by: Jerry | last post by:
Hi, I've been getting dozens of the same exceptions every week from our web server (running asp.net v1.1). I looked at the viewstate in the exception, all of them shared the same problem: having...
3
5046
by: Ken Shimizu | last post by:
I get an error when submitting an .ASPX page in Safari beta, MAC and PC document.getElementbyId(‘FolderBrowser’).submit(); After the server side code has executed without problems I get the...
3
680
by: sck10 | last post by:
Hello, I have a web project (VS 2008 c#). I have a page that opens, but when I try to call an assembly (managed c++) on a submit event, I get the following error on the web server, but not on...
0
7111
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7031
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7485
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5042
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.