如何在保留上一页数据的同时返回上一页 [英] How To Go Back To Previous Page While Retaining The Previous Page Data

查看:221
本文介绍了如何在保留上一页数据的同时返回上一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用asp.net2008.在我的表单中,例如:"form1",我输入一些详细信息.在该表单中,我有注册按钮.当我按该按钮时,它会进入注册表单.完成注册后,它将重定向到"

解决方案

ASP.NET中没有可用的即开即用功能来实现此目的. br/> 逐步执行以下操作.

1.在Form1的按钮单击处理程序中,将会话中的Form1数据序列化并重定向到Form2.
2.注册完成后,控件将用户重定向到Form1,在form1的页面Load handler中,反序列化来自会话的数据,并填充控件并清除会话中的数据.


如果这解决了您的问题,请将其标记为答案.


使用Javascript history.back();或history.go(-1);实现此目的的方法.
以下代码应执行以下操作:

< a id =''acrBack''onclick =''javascript:history.back();''>返回</a>


I am using asp.net 2008 .In my form eg:"form1", i enter some details .in that form i have register button.when i press that it goes to registration form.After completing registration it redirect to "form1" .I want to retaining that previously entered details in that form1.

解决方案

There is no out of the box feature available in ASP.NET for achieving this.
Do the following this step by step.

1. In the button click handler of Form1 serialize the Form1 data in session and redirect to Form2.
2. When the registration done and the control redirects the user to Form1, in the page Load handler of form1 deserialize the data from session and populate the controls and clear the data from session.


If this solves your problem please mark it as answer.


Use Javascript history.back(); or history.go(-1); method to achieve this.
The following piece of code should do this :

<a id=''acrBack'' onclick=''javascript:history.back();''>Go back</a>


这篇关于如何在保留上一页数据的同时返回上一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆