Re: the most cost effective way to persist page level objects in server
- From: "George" <noemail@xxxxxxxxxxx>
- Date: Mon, 19 Jan 2009 20:32:28 -0500
I am not sure I understood the phrase "as long as the client stay in the same page"
I have a feeling you do not realize the lifetime of the page object.
Here is the live of the page
1. Browser send request to the server.
2. Page object is create
3. Page object renders back HTML and it's buffered.
4. Page object is destroyed and buffer sent back to the browser
5. Browser renders HTML.
So if you need to keep your object between 1 and 5 then use Context.Items collection.
If you need to keep your object between browser request then you can use
1. ViewState (you said you do not want to use it).
2. ViewState that is kept on a server so it's not sent to browser. (Google it)
George.
"Ryan Liu" <ryanliu_99@xxxxxxxxxxx> wrote in message news:OmOUjdpeJHA.5932@xxxxxxxxxxxxxxxxxxxxxxx
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
.
- Follow-Ups:
- Re: the most cost effective way to persist page level objects in server
- From: Mark Rae [MVP]
- Re: the most cost effective way to persist page level objects in server
- From: Ryan Liu
- Re: the most cost effective way to persist page level objects in server
- References:
- Prev by Date: Accessing Delete Command from a button in a Repeater Control
- Next by Date: Re: the most cost effective way to persist page level objects in server
- Previous by thread: the most cost effective way to persist page level objects in server
- Next by thread: Re: the most cost effective way to persist page level objects in server
- Index(es):
Relevant Pages
|