想实现用户填完表单,跳转到下一个页面后,还可以返回上一页面修改数据,但此过程不存储任何数据,只是暂存,当用户点击提交后才会存储。
问题很菜,不过困扰N久,感觉用Session或者Cookie都比较复杂,哪位有方便快捷的办法指点一下吧,多谢了!

解决方案 »

  1.   

    ……那就只有ViewState——会更复杂
      

  2.   

    放进ViewState中,页面级的缓存
      

  3.   

    跳到其它页面,不可能还用ViewState 用 Session 吧,不难呀 Session["aaaa"] = xxxx;
    xxxx=(DataSet)Session["aaaa"]
      

  4.   

    先回答几个问题:
    数据建模、业务设计、用户界面是否合理?我的建议是,除了存在必须由服务器端控制的业务流程,请不要把数据分为几次提交
    ——可以用客户端脚本控制界面状态的切换如果部分流程必须由服务器端控制,为了在不同页面间保存数据状态,缓存是必须的,不同就是缓存放在服务器端还是客户端的问题1、客户端:cookie,viewstate(就是隐藏的input,适用于在一个页面内的多次回发间)
    2、服务器端:会话缓存,应用程序缓存个人以为,在以上几种方案中,会话缓存是最直接有效的
      

  5.   

    you may store your data in the dataset temp,,,,
    then you can update your database
      

  6.   

    谢谢楼上各位。
    因为数据关系比较复杂,不完全是一对一存储,所以需要分开页面。
    Session是最简单有效的,但相对于用户,有一个时间限制,如果超时,就等于没有作用了。
    To uno(钢盅郭子):
    “可以用客户端脚本控制界面状态的切换”具体如何操作呢?请赐教!
      

  7.   

    就是把整个流程中的页面表单都整合到一个页面中通过javascript控制不同部分的显示和隐藏咯
      

  8.   

    应该将整个流程整合到同一个页面中.将通过容器控件的可见性来决定让用户走到哪一步,各步骤间需要保持的数据放在页面的ViewState中.这种事不应该用Session做,因为你很难决定何时将Session里的这些数据Remove掉.
      

  9.   

    Wizard控件的功能用panel控件同样可以做到!只不过微软封装了一下而已!相比而言,wizard更智能,写的代码少了!(补充:经过试验,该控件的性能非常优异。)后台代码: protected void btn1saveandnext_Click(object sender, EventArgs e)
            {            
                Wizard1.ActiveStepIndex = 1;
            }
            protected void btn2prev_Click(object sender, EventArgs e)
            {            
                Wizard1.ActiveStepIndex = 0;
            }
            protected void btn3prev_Click(object sender, EventArgs e)
            {
                Wizard1.ActiveStepIndex = 1;
            }
            protected void btn4prev_Click(object sender, EventArgs e)
            {
                Wizard1.ActiveStepIndex = 2;
            }
            protected void btn5prev_Click(object sender, EventArgs e)
            {
                Wizard1.ActiveStepIndex = 3;
            }             protected void btn2next_Click(object sender, EventArgs e)
            {            
                Wizard1.ActiveStepIndex = 2;
            }
            protected void btn3next_Click(object sender, EventArgs e)
            {
                Wizard1.ActiveStepIndex = 3;
            }
            protected void btn4next_Click(object sender, EventArgs e)
            {
                Wizard1.ActiveStepIndex = 4;
            } 前台展示层:<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0">
                <WizardSteps>  
                    <asp:WizardStep ID="WizardStep1" runat="server" Title="">
                        <table width="780" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td colspan="4" align="left">第一步:基本信息</td>
                            </tr> 
                            <tr>
                                <td style="width:180px"></td>
                                <td style="width:210px"></td>
                                <td style="width:180px"></td>
                                <td style="width:210px"></td>
                            </tr> 
                            <tr>
                                <td colspan="4" align="right">
                                    <asp:Button ID="btn1saveandnext" runat="server" Text="保存&amp;下一步" OnClick="btn1saveandnext_Click" /> 
                                </td>
                            </tr>           
                        </table>
                    </asp:WizardStep>  
                                  
                    <asp:WizardStep ID="WizardStep2" runat="server"  Title="">
                         <table width="780" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td colspan="4" align="left">第二步:教育背景</td>
                            </tr> 
                            <tr>
                                <td style="width:180px"></td>
                                <td style="width:210px"></td>
                                <td style="width:180px"></td>
                                <td style="width:210px"></td>
                            </tr> 
                            <tr>
                                <td colspan="4" align="right">
                                    <asp:Button ID="btn2prev" runat="server" Text="上一步" OnClick="btn2prev_Click"/>
                                    <asp:Button ID="btn2saveandnew" runat="server" Text="保存&amp;新增" />
                                    <asp:Button ID="btn2next" runat="server" Text="下一步" OnClick="btn2next_Click" />
                                </td>
                            </tr>           
                        </table> 
                    </asp:WizardStep>
                    
                     <asp:WizardStep ID="WizardStep3" runat="server"  Title="">
                        <table width="780" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td colspan="4" align="left">第三步:工作及项目信息</td>
                            </tr> 
                            <tr>
                                <td style="width:180px"></td>
                                <td style="width:210px"></td>
                                <td style="width:180px"></td>
                                <td style="width:210px"></td>
                            </tr> 
                            <tr>
                                <td colspan="4" align="right">
                                    <asp:Button ID="btn3prev" runat="server" Text="上一步" OnClick="btn3prev_Click"/>
                                    <asp:Button ID="btn3saveandnew" runat="server" Text="保存&amp;新增" />
                                    <asp:Button ID="btn3next" runat="server" Text="下一步" OnClick="btn3next_Click"/>
                                </td>
                            </tr>           
                        </table>
                    </asp:WizardStep>
                    
                     <asp:WizardStep ID="WizardStep4" runat="server"  Title="">                 
                        <table width="780" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td colspan="4" align="left">第四步:掌握技术</td>
                            </tr> 
                            <tr>
                                <td style="width:180px"></td>
                                <td style="width:210px"></td>
                                <td style="width:180px"></td>
                                <td style="width:210px"></td>
                            </tr> 
                            <tr>
                                <td colspan="4" align="right">
                                    <asp:Button ID="btn4prev" runat="server" Text="上一步" OnClick="btn4prev_Click"/>
                                    <asp:Button ID="btn4saveandnew" runat="server" Text="保存&amp;新增" />
                                    <asp:Button ID="btn4next" runat="server" Text="下一步" OnClick="btn4next_Click"/>
                                </td>
                            </tr>           
                        </table>                   
                    </asp:WizardStep>
                    
                    <asp:WizardStep ID="WizardStep5" runat="server"  Title="">
                        <table width="780" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td colspan="4" align="left">第五步:职业技能及素质描述</td>
                            </tr> 
                            <tr>
                                <td style="width:180px"></td>
                                <td style="width:210px"></td>
                                <td style="width:180px"></td>
                                <td style="width:210px"></td>
                            </tr> 
                            <tr>
                                <td colspan="4" align="right">
                                    <asp:Button ID="btn5prev" runat="server" Text="上一步" OnClick="btn5prev_Click"/>
                                    <asp:Button ID="btn5finish" runat="server" Text="完成" />
                                </td>
                            </tr>           
                        </table>                    
                    </asp:WizardStep>
                </WizardSteps>  
                <StartNavigationTemplate>               
                </StartNavigationTemplate>                 
                <StepNavigationTemplate>              
                </StepNavigationTemplate>
                <FinishNavigationTemplate>               
                </FinishNavigationTemplate>
                <SideBarTemplate>                               
                </SideBarTemplate>
            </asp:Wizard>   
      

  10.   

    可以分别放到一个面版容器里,点击下一页的时候将容器的可视设为flase
      

  11.   

    楼上的大哥,我用的是asp.net1.0,2.0的控件没法用 :(现在不是程序在几个页面上存在的问题,而是信息录入后,需要一个让用户确认的过程,如果用户不确认,则需要返回上一层继续修改,此过程需要缓存数据。
      

  12.   

    把你的数据放到一个对象里,把对象存到session里
      

  13.   

    “而是信息录入后,需要一个让用户确认的过程”?这步骤完全可以在客户端解决用脚本把所有input设为disabled弹出对话框或用div交互获取用户确认信息
      

  14.   

    我觉得这个用cookie得方式比较好,前一个页面存储条件到cookie中,点击返回得时候去读取
      

  15.   

    Session比较方便,用一个DataTable保存数据,把这个DataTable直接放到Session中!
      

  16.   

    用session怕丟,就啓用state server啊