Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

UserControls, Properties and the ViewState

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
trullock@googlemail.com - 19 Feb 2008 19:00 GMT
Hi,

To make my usercontrol remember the values i set in its public
properties across postbacks, do i need to explicity write code in the
getters and setters to enter the data into the viewstate?

I'm hoping there's some decoration (or something else) i can apply to
the properties to make their values be persisted automatically?

Thanks for any advice

Andrew
Scott Roberts - 19 Feb 2008 19:23 GMT
> Hi,
>
> To make my usercontrol remember the values i set in its public
> properties across postbacks, do i need to explicity write code in the
> getters and setters to enter the data into the viewstate?

Yes. Or, use something other than viewstae (e.g. put your public properties
into a class and store an instance of the class in the session).

> I'm hoping there's some decoration (or something else) i can apply to
> the properties to make their values be persisted automatically?

Not to my knowledge.
trullock@googlemail.com - 19 Feb 2008 20:22 GMT
On Feb 19, 7:23 pm, "Scott Roberts" <srobe...@no.spam.here-webworks-
software.com> wrote:
> <trull...@googlemail.com> wrote in message
>
[quoted text clipped - 13 lines]
>
> Not to my knowledge.

Thanks for the info

Andrew

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.