Retaining values in ASP.Net webform.

G

Guest

Hello all -

I can't seem to find what could be causing this issue so I wanted to appeal to the .NET gurus out there. When I have users input values into Page 1 and submit it, I want the ability so that the user can navigate back from Page 2 (through clicking the "Back" button) and the values they just put in (text boxes) or selected (listboxes) are retained. Right now, though, the page is completely cleaned to blank and the user ends up having to re-input the data. Is there a property that I'm not aware of in .NET that retains values. A few people and research has suggested something about AutoNavigation property set to true but wasn't sure if it was related

Thanks
Mark
 
T

Teemu Keiski

Hi,

this would need keeping the values on Session, database or by utilizing
custom ViewState restoring that occurs after redirect (normally is cleared
as you saw). This article tells about the ViewState restoring:

ViewState: Restore after Redirect
http://authors.aspalliance.com/PaulWilson/Articles/?id=10

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

Hello all -

I can't seem to find what could be causing this issue so I wanted to appeal
to the .NET gurus out there. When I have users input values into Page 1 and
submit it, I want the ability so that the user can navigate back from Page 2
(through clicking the "Back" button) and the values they just put in (text
boxes) or selected (listboxes) are retained. Right now, though, the page is
completely cleaned to blank and the user ends up having to re-input the
data. Is there a property that I'm not aware of in .NET that retains
values. A few people and research has suggested something about
AutoNavigation property set to true but wasn't sure if it was related.

Thanks,
Mark
 
G

Guest

Teemu

I appreciate your response. I should added this to my original but what makes this perplexing is that even though the example makes sense, I have other pages I created where when I do hit the 'Back' button, the data is retained yet the code is nearly identical from what I can see between ones that do and ones that don't retain values in their pages. I don't have ViewState anywhere set in the pages that do retain the values as well

Any ideas from anyone are appreciated at this point

Thanks
Mar

----- Teemu Keiski wrote: ----

Hi

this would need keeping the values on Session, database or by utilizing
custom ViewState restoring that occurs after redirect (normally is cleared
as you saw). This article tells about the ViewState restoring

ViewState: Restore after Redirec
http://authors.aspalliance.com/PaulWilson/Articles/?id=1

--
Teemu Keisk
MCP, Microsoft MVP (ASP.NET), AspInsiders membe
ASP.NET Forum Moderator, AspAlliance Columnis

Hello all

I can't seem to find what could be causing this issue so I wanted to appeal
to the .NET gurus out there. When I have users input values into Page 1 and
submit it, I want the ability so that the user can navigate back from Page 2
(through clicking the "Back" button) and the values they just put in (text
boxes) or selected (listboxes) are retained. Right now, though, the page is
completely cleaned to blank and the user ends up having to re-input the
data. Is there a property that I'm not aware of in .NET that retains
values. A few people and research has suggested something about
AutoNavigation property set to true but wasn't sure if it was related

Thanks
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top