Solved

VIEWSTATE hidden field.

Posted on 2004-08-17
8
216 Views
Last Modified: 2010-04-07
Hi All,
I have an aspx page...
It is a search form, has adropdown list asp control with other controls.
The list items are filled from a database, the number of records returned are around 50 records.
The form has a button to post the data, when i click it, it didn't work, no posting...
When i minimize the number of records returned(number of list items), the form works successfully,,,
i think the reason is in the VIEWSTATE field, i think it can contains a fixed number of characters...
If this is what cause the problem, Is there any way to enlarge its size??
If not, please help, so i can know what the problem is?

Thankx in advanced
samjav
0
Comment
Question by:samjav
8 Comments
 
LVL 8

Accepted Solution

by:
shovavnik earned 50 total points
Comment Utility
Don't use the viewstate for large amounts of information.  It does have a limit and is intended for maintaining state, not data.

Use the session object.

Everywhere you have ViewState[], replace it with Session[].

If you can't use the session object, you'll have to persist your info in other ways.  First try using the session.
0
 
LVL 17

Assisted Solution

by:AerosSaga
AerosSaga earned 50 total points
Comment Utility
are you using view state during page unload?

Do not attempt to store ViewState information in the Page.Unload event. Although no error will be thrown, the information will not be stored. This is because by the time the Page.Unload event is fired, the HTML has already been created.

http://www.raritanval.edu/departments/cis/full-time/Schwarz/aspdotnet/Chapter10.htm

Regards,

Aeros
0
 

Author Comment

by:samjav
Comment Utility
i meant the "__VIEWSTATE" hidden filed generated by the page when it is called.
This field has value of long increpted string.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 17

Expert Comment

by:AerosSaga
Comment Utility
Heres a work around using java:

http://www.codeproject.com/aspnet/jsnopostback.asp

Regards,

Aeros
0
 
LVL 33

Assisted Solution

by:raterus
raterus earned 50 total points
Comment Utility
The viewstate doesn't have a limit in size, but it does have it's drawbacks.  While it is great, realize that your users not only have to download that field, but also send it back to the server when they postback the form.  If you are storing large objects like a DataSet in it, your users are going be faced with a very slow page.  If you have large controls like a DataGrid on your page, that can fill up the viewstate quickly.
0
 
LVL 17

Expert Comment

by:AerosSaga
Comment Utility
and by the way it is not encrypted, but base64 encoded
0
 
LVL 17

Expert Comment

by:AerosSaga
Comment Utility
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

728 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

10 Experts available now in Live!

Get 1:1 Help Now