Saving viewstate to the server

D

Denis Georgievski

I am optimizing my web application written in ASP/VB.NET 1.1. I have number
of pages that have dropdown list server controls that contain large number
of items. Before redesigning the data access I would like to try by saving
the view state to the server if this can speed up the access to these heavy
pages. Could somebody give me a working example on saving the viewstate to
the server written in VB.



Thanks



Denis
 
M

Martin Dechev

Hi,

To store the ViewState in the session:

Public Class default_aspx
Inherits System.Web.UI.Page

Protected Overrides Sub _
SavePageStateToPersistenceMedium( _
ByVal viewState As Object)
Session("ViewState") = viewState
End Sub

Protected Overrides Function _
LoadPageStateFromPersistenceMedium() As Object
Return Session("ViewState")
End Function

'... The rest of the class ...

End Class

Greetings
Martin
 
D

Denis Georgievski

Thanks Martin,

This reduced the weight of my pages by 50-60%.

Regrads,

Denis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,163
Latest member
Sasha15427
Top