Thanks for your quick response David,
As for ViewState, you may need to read some other reference so as to better
understand it's mechanism and how it working with the asp.net page's
lifecycle. here are some useful reference on asp.net viewstate and
webcontrol state management:
#Understanding ASP.NET View State
http://msdn.microsoft.com/library/en...asp?frame=true
#ASP.NET State Management
http://msdn.microsoft.com/library/en...tatemanagement
..asp?frame=tru e
#Creating Custom Web Controls with ASP.NET 2.0
http://msdn.microsoft.com/library/en....asp?frame=tru
e
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "David Lozzi" <Da********@nos pam.nospam>
| References: <Oa************ **@TK2MSFTNGP09 .phx.gbl>
<#d************ **@TK2MSFTNGP15 .phx.gbl>
<eT************ **@TK2MSFTNGP09 .phx.gbl>
<IR************ **@TK2MSFTNGXA0 2.phx.gbl>
| Subject: Re: User Controls not keeping property values
| Date: Tue, 20 Dec 2005 01:14:56 -0500
| Lines: 104
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <OP************ **@TK2MSFTNGP11 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: c-24-63-42-200.hsd1.ma.com cast.net 24.63.42.200
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP11.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3658 65
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| That works great. Any precautions I should be aware of when using the
| ViewState? Does it empty itself?
|
| Thanks,
|
| --
| David Lozzi
| Web Applications Developer
|
dlozzi@(remove-this)delphi-ts.com
|
|
|
| "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| news:IR******** ******@TK2MSFTN GXA02.phx.gbl.. .
| > Hi David,
| >
| > I think Christopher's consideration are reasonable. ASP.NET web pages
are
| > request/response based, and all the in-memory page variables are not
| > persisted between mulitple page requests(postba ck....). So if we want
some
| > certain member varriables to be persisted and shared between postbacks,
we
| > need to store them into some persistent storage, such as SessionState or
| > Viewstate....
| >
| > e.g:
| > ===============
| > Public Property Height() As Integer
| > Get
| >
| > Return ViewState("__HE IGHT")
| >
| > End Get
| >
| > Set(ByVal Value As Integer)
| >
| > ViewState("__HE IGHT") = value
| >
| > End Set
| >
| > End Property
| > =============== ==
| >
| > Also, you can add some additional code to do bad value protection in the
| > property accessor....
| >
| > Hope helps. Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure!
www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| >
| >
| > --------------------
| > | From: "David Lozzi" <Da********@nos pam.nospam>
| > | References: <Oa************ **@TK2MSFTNGP09 .phx.gbl>
| > <#d************ **@TK2MSFTNGP15 .phx.gbl>
| > | Subject: Re: User Controls not keeping property values
| > | Date: Mon, 19 Dec 2005 18:48:40 -0500
| > | Lines: 18
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| > | X-RFC2646: Format=Flowed; Response
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| > | Message-ID: <eT************ **@TK2MSFTNGP09 .phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: c-24-63-42-200.hsd1.ma.com cast.net 24.63.42.200
| > | Path:
| >
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA01.phx.gbl!T K2MSFTFEED02.ph x.gbl!tornado.f a
| >
stwebnet.it!tis cali!newsfeed1. ip.tiscali.net! news.glorb.com! newsfeed.hal-mli
| >
net!feeder1.hal-mli.net!news.al t.net!msrtrans! TK2MSFTNGP08.ph x.gbl!TK2MSFTN
| > GP09.phx.gbl
| > | Xref: TK2MSFTNGXA02.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:3658 34
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > |
| > | It is not, its just part of a form.
| > |
| > | --
| > | David Lozzi
| > | Web Applications Developer
| > |
dlozzi@(remove-this)delphi-ts.com
| > |
| > |
| > |
| > | "Ben Dewey" <As*********@ho tmail.com> wrote in message
| > | news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
| > | > Is your user control inside a databound control? a repeater or a
| > | > datagrid?
| > | >
| > | > If so what kind? and when/how are you setting the UserControl data?
| > | >
| > |
| > |
| > |
| >
|
|
|