473,569 Members | 2,428 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.Deser ialize method takes a couple seconds which is a long
time.

protected override object LoadPageStateFr omPersistenceMe dium()
{
object viewState;
string tempViewState;
tempViewState = (string)this.Ca che["ViewState"];
LosFormatter formatter = new LosFormatter();
try
{
viewState = formatter.Deser ialize(tempView State);
}
catch(Exception x)
{
throw new HttpException ("Invalid viewstate:" + x.ToString());
}
return viewState;
}

Apr 25 '06 #1
2 1802
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.Deser ialize method takes a couple seconds which is a long
time.

protected override object LoadPageStateFr omPersistenceMe dium()
{
object viewState;
string tempViewState;
tempViewState = (string)this.Ca che["ViewState"];
LosFormatter formatter = new LosFormatter();
try
{
viewState = formatter.Deser ialize(tempView State);
}
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
1420
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 fancy here. I use my own custom session implementation for all users who log into the app. Each such session has its encrypted unique string, blah...
6
6031
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 length, Int32& dataLength) +195 System.Web.UI.LosFormatter.Deserialize(String input) +60
0
1356
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 our site. When first time users come to the site they are redirected to a select location page where they need to select a country so we can show...
7
3533
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 TypeConverter other than ReferenceConverter to be put in viewstate." I've included the <Serializable()> attribute, but I'm still getting the same...
5
3264
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 bound to a datagrid on the same page. It works 90% of the time as expected. However, for some unknown reason, I randomly get the error below. The...
1
3029
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 in any phase (any step) and to be able to continue later. My idea was to create several pages as steps (no, wizard control is not suitable for...
1
1342
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 some extra characters (0x21 0x0d 0x0a 0x20, which is "!\r\n ") inserted after the 978th character. There's no server farm or load balancing and...
3
5048
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 following error. Server Error in '/FileWayTest' Application. --------------------------------------------------------------------------------...
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 my development machine. It seems that this is the only dll in the Bin folder that has this problem. Any help with this would be appreciated....
0
7618
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7679
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3657
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.