wait, think i misread your post, what do you mean by instance variables =
? ;P
"Alessandro Zifiglio" <alessandrozifiglio@NO-SPAM-hotmail.com> wrote =
in message news:ZBEIb.22430$i_5.21033@news.edisontel.com...
hi Nadav,
add the declaration PersistenceMode(PersistenceMode.InnerProperty) =
over your property. This Specifies how an ASP.NET server control =
property or event is persisted declaratively in an .aspx or .ascx file.
*Note that : PersistenceMode(PersistenceMode.InnerProperty) Specifies =
that the property persists in the ASP.NET server control as a nested =
tag. This is commonly used for complex objects; those that have =
persistable properties of their own
Look in the docs for more info, search under "PersistenceMode =
Enumeration"
As an alternative you can Specifiy how a property on a component is =
saved by a designer using DesignerSerializationVisibilityAttribute =
Class, it all depends on what you want to do and how you want to persist =
the data.
If you want it to go into the
[quoted text, click to view] "Nadav" <nadav@e-finitygroup.com> wrote in message =
news:015501c3cfc5$1c988390$a101280a@phx.gbl...
> I am building custom controls with <asp: tags and=20
> instance variables.
>=20
> The <asp: tags persist between post backs but the=20
> instance variables do not. How do I get around this?
>=20
Hi Nadav,
Thanks for posting in this group.
Based on my understanding, you are building a custom control which has many
"customized" member variables associated it. But when postback, you find
these member variables' did not keep it original value(The value that being
set in first load time)
Actually, in asp.net web form mechanism, a control's life time is very
short on server side. Because of Http protocol's stateless, asp.net persist
the control's state through ViewState. Asp.net will persist the pre-defined
fields of control in ViewState, while for the persistence of customized
variables, you should persist them in viewstate yourself.
For more information about state management, please refer to the articles
below:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconmantainingstateincontrol.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/
vbconchoosingserverstateoption.asp
Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security This posting is provided "as is" with no warranties and confers no rights.