viewstate

  • Thread starter javier ferrero via .NET 247
  • Start date
J

javier ferrero via .NET 247

try adding this code:





protected override object LoadPageStateFromPersistenceMedium()
{
return Session["_ViewState"];
}

protected override void SavePageStateToPersistenceMedium(object viewState)
{
Session["_ViewState"] = viewState;
}


please tell me if it works
 
N

Natty Gur

Hi,

Technically it will work. I use this technique to prevent viewsate on
page. the problem is that viewstate data preserved on your server. if
you operating in cluster environment data that preserved in one machine
wont be preserved in other (unless you change default session
persistence and thus hurting application RPS). On the other hand your
application move less bytes over network which can cause your page load
faster on client browser.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)52-8888377


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
H

Hans Kesting

javier ferrero via .NET 247 said:
try adding this code:





protected override object LoadPageStateFromPersistenceMedium()
{
return Session["_ViewState"];
}

protected override void SavePageStateToPersistenceMedium(object viewState)
{
Session["_ViewState"] = viewState;
}


please tell me if it works

One possible problem: if the user uses the "back" button, you get the viewstate
of the wrong page.

Hans Kesting
 

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,596
Members
45,143
Latest member
DewittMill
Top