By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,686 Members | 1,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,686 IT Pros & Developers. It's quick & easy.

ViewState - urgent help needed!

P: n/a
The way I've built my page is to take the user through a multi-form process,
only rendering those controls that are needed for each section. The
ViewState is working the way I want it to, remembering items across the
process, back and forth. But when the user finally opts to complete the
sections and commit the information for processing, I can't access any of
the information that was not rendered on the last section. It's obviously
in the ViewState, since the page remembers the value, but I can't figure out
how to read those values.

The controls I am trying to get the values for are databound controls. I
don't know if this makes a difference or not.
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Random:
Depending on how this was done, you likely have to rebuild all the controls
in order to get their value. You mentioned that they are all databound, so
this is particularly true. While viewstate maintains the values, it doesn't
assign them to controls unless they exist. When the final "save" is
clicked, only the last form exists and thus it's the only one the page can
repopulate from the viewstate...all forms would need to be recreated in
order for the page to repopulate their value and have you access them.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Random" <ci*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
The way I've built my page is to take the user through a multi-form process, only rendering those controls that are needed for each section. The
ViewState is working the way I want it to, remembering items across the
process, back and forth. But when the user finally opts to complete the
sections and commit the information for processing, I can't access any of
the information that was not rendered on the last section. It's obviously
in the ViewState, since the page remembers the value, but I can't figure out how to read those values.

The controls I am trying to get the values for are databound controls. I
don't know if this makes a difference or not.

Nov 19 '05 #2

P: n/a
That's what I was afraid of. And the page won't let me rebuild server
controls with the same ID because they already exist. How pitiful.

Geez, and ASP.NET is supposed to cut down on development time. This is
taking me five times as long as it would have in classic ASP, just because
of the workarounds.
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:er**************@TK2MSFTNGP11.phx.gbl...
Random:
Depending on how this was done, you likely have to rebuild all the
controls
in order to get their value. You mentioned that they are all databound,
so
this is particularly true. While viewstate maintains the values, it
doesn't
assign them to controls unless they exist. When the final "save" is
clicked, only the last form exists and thus it's the only one the page can
repopulate from the viewstate...all forms would need to be recreated in
order for the page to repopulate their value and have you access them.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Random" <ci*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
The way I've built my page is to take the user through a multi-form

process,
only rendering those controls that are needed for each section. The
ViewState is working the way I want it to, remembering items across the
process, back and forth. But when the user finally opts to complete the
sections and commit the information for processing, I can't access any of
the information that was not rendered on the last section. It's
obviously
in the ViewState, since the page remembers the value, but I can't figure

out
how to read those values.

The controls I am trying to get the values for are databound controls. I
don't know if this makes a difference or not.


Nov 19 '05 #3

P: n/a

"Random" <ci*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
The way I've built my page is to take the user through a multi-form process, only rendering those controls that are needed for each section. The
ViewState is working the way I want it to, remembering items across the
process, back and forth. But when the user finally opts to complete the
sections and commit the information for processing, I can't access any of
the information that was not rendered on the last section. It's obviously
in the ViewState, since the page remembers the value, but I can't figure out how to read those values.

The controls I am trying to get the values for are databound controls. I
don't know if this makes a difference or not.

You can place your own items in viewstate and retrieve them at the time of
committing the last form. Hope this helps.
Mike
Nov 19 '05 #4

P: n/a
Thanks, Mike. Yes, this is what I am ending up doing. I don't wish to be
taken wrong, I know it's just a learning curve. I'm just frustrated that
many tasks that I would be able to do fast and simply in classic ASP, there
seems to be a huge workaround needed to get it to work with .NET.

There are many other workarounds I've had to make on this page because of
the difficulty in getting the html controls and server controls to work
together. It would all be MUCH simpler if ASP.NET would not rename all the
server controls on the client side.
"vMike" <Mi****************@noZorY.geZwaYrrenY.com> wrote in message
news:ct**********@ngspool-d02.news.aol.com...

"Random" <ci*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
The way I've built my page is to take the user through a multi-form

process,
only rendering those controls that are needed for each section. The
ViewState is working the way I want it to, remembering items across the
process, back and forth. But when the user finally opts to complete the
sections and commit the information for processing, I can't access any of
the information that was not rendered on the last section. It's
obviously
in the ViewState, since the page remembers the value, but I can't figure

out
how to read those values.

The controls I am trying to get the values for are databound controls. I
don't know if this makes a difference or not.

You can place your own items in viewstate and retrieve them at the time of
committing the last form. Hope this helps.
Mike

Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.