most cost effective way to persist page level objects in server side in asp.net

R

Ryan Liu

Hi,

What is the most cost effective way to persist page level objects in server
side in asp.net?

I know I can use session, but session is beyond page scope, seems a little
bit waste to me, and it is bad to make it visible in other pages as well.

Ocz I can use view state, but it is persisted though client, not in server
side, which is also waste of network and serialization/de-serialization,
and even more dangerous expose it to client.

And other approach like form hidden fields, query string not to mention is
even worse, plus I lost "object", have to deal with strings manually.

Is there a nice, efficient, safe way/framework to just deal object in server
side for just one particular page -- as long as the client stay in the same
page?

This will be very useful when deal data-binding/edit scenario.

Thanks,
Ryan
 
P

Pavel Minaev

Hi,

What is the most cost effective way to persist page level objects in server
side in asp.net?

I know I can use session, but session is beyond page scope, seems a little
bit waste to me, and it is bad to make it visible in other pages as well.

Ocz I can use view state, but it is persisted though client, not in server
side,  which is also waste of network and serialization/de-serialization,
and even more dangerous expose it to client.

The obvious simple answer is to use the viewstate to store the token
(a number or a GUID), and session to store the object itself, keyed by
that token. That way, you still have page-specific semantics, but the
actual data is all server-side.
 

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

Top