asp.net controls losing value after asp button click event
Posted on 2009-07-09
I have buit a questionnaire, and have a problem with the values being cleared after the user clicks on asp button.
This is what I have:
I have 1 form 1 page divided into sections ( step1, step2, step3, etc.) each section (step) is a table enclosed in a <div id="step#" runat="server">
In the code behind aspx.vb page on page load I have
If page.ispostback() then
' do nothing
step2.visible = false
step3.visbile = false
At the bottom of each section I have a asp button btn_continue1, btn_continue2, etc. As a user clicks on the continue button depending on step, the last step will hide and the next step will show using step#.visible = true ( in the code behind).
The problem I have is if a user fills out step2, but then hits the back button to step1 and then hits the continue button to step2; the values they previously filled out on step2 are now cleared.
Why is this happening?