How to know that viewstates a control save ? for example a DropDownList control.

  • Thread starter Thread starter xu
  • Start date Start date
Can u please rephrase that? Not sure if I got it right...

If you are loking for the option for the state on a dropdownlist to be stored on
viewstate then what you are looking for is the enableviewstate property. This is
a common property in webcontrols.

Joao Cardoso (MVP dotNET)
=======================================================
[LusoCoders]- http://groups.yahoo.com/group/lusocoders/
[PontoNetPT]- http://www.programando.net/regras.aspx
(e-mail address removed)-s.p-a.m - www.acinet.pt
=======================================================
 
Thank your reply.

I want to know what properties of a control will be need to re-initialize by
programmer,what properties of a control will be assigned by viewstates or
postback-date automatically when a page are postbacking.
 
Hi,

general rule is that those properties that are posted by default by the
control, are not persisted in ViewState weheras those proeprties that can't
be maintained without ViewState mechanism are again persisted through it.

TextBox's Text is an example of property that is posted automatically.
ViewState is used with it, but to detect if the value ahs been changed since
last postback (which is informed by raising TextChanged event). Sae idea is
with DropDownList, SelectedItem and SelectedIndexChanged event.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist



xu said:
Thank your reply.

I want to know what properties of a control will be need to re-initialize by
programmer,what properties of a control will be assigned by viewstates or
postback-date automatically when a page are postbacking.


Joao S Cardoso said:
Can u please rephrase that? Not sure if I got it right...

If you are loking for the option for the state on a dropdownlist to be stored on
viewstate then what you are looking for is the enableviewstate property. This is
a common property in webcontrols.

Joao Cardoso (MVP dotNET)
=======================================================
[LusoCoders]- http://groups.yahoo.com/group/lusocoders/
[PontoNetPT]- http://www.programando.net/regras.aspx
(e-mail address removed)-s.p-a.m - www.acinet.pt
=======================================================
 
I mean if the property of a control will be posted or persisted in ViewState
when i use it, the point isn't explained in the documents. If can i be aware
of it by testing only?

Teemu Keiski said:
Hi,

general rule is that those properties that are posted by default by the
control, are not persisted in ViewState weheras those proeprties that can't
be maintained without ViewState mechanism are again persisted through it.

TextBox's Text is an example of property that is posted automatically.
ViewState is used with it, but to detect if the value ahs been changed since
last postback (which is informed by raising TextChanged event). Sae idea is
with DropDownList, SelectedItem and SelectedIndexChanged event.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist



xu said:
Thank your reply.

I want to know what properties of a control will be need to
re-initialize
by
programmer,what properties of a control will be assigned by viewstates or
postback-date automatically when a page are postbacking.


Joao S Cardoso said:
Can u please rephrase that? Not sure if I got it right...

If you are loking for the option for the state on a dropdownlist to be stored on
viewstate then what you are looking for is the enableviewstate
property.
This is
a common property in webcontrols.

Joao Cardoso (MVP dotNET)
=======================================================
[LusoCoders]- http://groups.yahoo.com/group/lusocoders/
[PontoNetPT]- http://www.programando.net/regras.aspx
(e-mail address removed)-s.p-a.m - www.acinet.pt
=======================================================
 
Back
Top