473,320 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Saving viewstate to the server

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
Nov 18 '05 #1
3 1530
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
"Denis Georgievski" <de***@cergis.com> wrote in message
news:#0**************@TK2MSFTNGP09.phx.gbl...
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

Nov 18 '05 #2
Thanks Martin,

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

Regrads,

Denis
"Martin Dechev" <de*******@hotmail.com> wrote in message
news:ui**************@TK2MSFTNGP12.phx.gbl...
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
"Denis Georgievski" <de***@cergis.com> wrote in message
news:#0**************@TK2MSFTNGP09.phx.gbl...
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


Nov 18 '05 #3
Hi,

Enabling http compression on the IIS gives even more drastical results. See:

http://support.microsoft.com/?kbid=322603

Greetings
Martin
"Denis Georgievski" <de***@cergis.com> wrote in message
news:OE**************@TK2MSFTNGP15.phx.gbl...
Thanks Martin,

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

Regrads,

Denis
"Martin Dechev" <de*******@hotmail.com> wrote in message
news:ui**************@TK2MSFTNGP12.phx.gbl...
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
"Denis Georgievski" <de***@cergis.com> wrote in message
news:#0**************@TK2MSFTNGP09.phx.gbl...
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



Nov 18 '05 #4

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

Similar topics

5
by: Michael Albanese | last post by:
Can you save objects a (custom class) to Viewstate and then get them on a later page?? I have a custom class for an ASP.Net application that I would like to make available across several web...
2
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid...
2
by: Gary Vidal | last post by:
I have a shopping cart webpage that shows a product and the Quantity they would like to order: When you click the link I want to take the quantity that they entered in the textbox and post that to...
3
by: Jim Corey | last post by:
I'm trying to save some ArrayLists to viewstate and then use them as DataSources for dropdownboxes. The code looks like this: 'DptList is a arraylist variable local to this procedure ...
4
by: John Kandell | last post by:
Hi, Would someone be able to shed some light on what is the cost of saving a DataTable to session vs saving a custom object of the same data. For example, let's say I had a DataTable with 1000...
3
by: RCS | last post by:
I have an app that I have different "sections" that I want to switch back and forth from, all while having the server maintain viewstate for each page. In other words, when I am on Page1.aspx and...
3
by: Ben Dewey | last post by:
Hey everyone, I have a wierd issue i can't seem to find out whats going on. I have a Control for a Shopping Cart Merchant Page called OrderStatus.ascx Inside that control there is a Repeater...
6
by: arun.hallan | last post by:
Hi, I have a datagrid whose datasource is a datatable which is saved to viewstate on page_load. I also have a cached string which handles what is shown on the rowfilter of the dataview of...
12
by: Nick C | last post by:
Hi How can i reduce the viewstate for my asp.net application. It is getting very large now. What is a good solution? thanks N
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.