Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > How to maintain the viewstate in server control?

Thread Tools

How to maintain the viewstate in server control?

J Gopinath
Posts: n/a
I am creating server control. Which is having one datagrid and three
Data Grid is playing all the records of particular table.
And the other four buttons are 'Add, Edit, Delete'.
When I click the 'Add' button, the new screen will be displayed.
In server control page, I'm using EnsureChildControls() method.
The method will check, whether childControlsCreated or not. If it is not
created and it will
call the CreateChildControls() method automatically (Basic for creating
server control).

Now the controls are created and I am clicking the 'add' button. Again it
calls the 'EnsureChildControls()' method.
And it automatically calls the CreateChildControls() method. So whenever I
post a request to server,
the server control rebuild and placed in the page. I don't want to rebuild
the server controls for every post back.
I want to maintain the server control as it is. So I use the ViewState to
handle it.
But ViewState is only for having the value of control and the control.
Then how to do it?. Is there any other way?.


Disclaimer Information contained in this E-MAIL being proprietary to Scape
Velocity, Inc is 'privileged', 'confidential' and intended for use only by
the individual or entity to which it is addressed. Any use or dissemination
of any information contained in the E-MAIL beyond that necessary to conduct
business with Scape Velocity, Inc. is strictly prohibited, except as may be
agreed to in writing between Scape Velocity and you or your organization. If
the reader of this message is not the intended recipient or agent
responsible for delivering this message to the intended recipient, you are
hereby notified that any dissemination, distribution, or copying of this
communication is prohibited. If you have received this communication in
error, please notify us immediately and delete this email. Scape Velocity,
Inc ------------------------------------------------------------------------
-- Global Software Development at the speed of 'e'

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
maintain viewstate in listboxes DC Gringo ASP .Net 5 11-09-2004 02:40 PM
maintain viewstate using dynamically loaded server controls Thijs ASP .Net Web Controls 2 12-04-2003 10:03 PM
Re: Listbox filled with Javascript does NOT maintain viewstate John Timney \(Microsoft MVP\) ASP .Net 0 08-29-2003 05:14 PM
Re: Listbox filled with Javascript does NOT maintain viewstate John Saunders ASP .Net 0 08-29-2003 05:08 PM