当用户返回到最后一页时,他在最后一页中提及的所有条目都将被删除 [英] When user go back to the last page all the entries he meintioned on the last page removed

查看:59
本文介绍了当用户返回到最后一页时,他在最后一页中提及的所有条目都将被删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我已经开发了一个Web应用程序,当用户返回时,所有条目都已过期.我希望当用户返回时,可以看到他们在最后一页上输入的所有条目.

例如,如果用户输入如下内容:

Hi All,

I have developed a web application and the when user goes back all the entries are expired. I want that when user goes back, all the entries they entered on the last page are viewable.

For example if a user entered like :

first page : User Name,User_ID<br />
Second Page : Q1<br />
Third Page : Q2<br />
Fourth Page : Q3<br />
Fifth Page : Q4<br />
Sixth Page : Complete



在数据库中,答案将根据用户ID保存.查询就像:



In database answer will save according to User ID. Query is like :

Update Q1= "value" where User_ID = @User_ID
Update Q2= "value" where User_ID = @User_ID
Update Q3= "value" where User_ID = @User_ID




因此,如果用户想再次编辑Q2,那么他可以返回并编辑最后一个答案,但是在我的情况下,当用户返回时,他的最后一个答案将保存在数据库中,而不是保存在页面上.因此,我希望他在完成之前可以查看或编辑以前的答案,然后就可以对其进行编辑.

任何帮助表示赞赏.




So if user want to edit Q2 again then he can go back and edit the last answer but in my case when user go back then his last answer will save in database but not on the page. So i want whenever he want to review or edit the previous answers before complete he can go and edit it.

Any help is appreciated.

Thanks.

推荐答案

如果用户单击浏览器的后退按钮,则他可以看到这些值,但我认为您可能在所有页面中都具有一个后退按钮来对其进行重定向到上一页.

单击按钮时,总是发生回发.因此页面将重新加载而没有任何值.

对于您的问题,当移至下一页时,可以将所有值存储在会话变量中.
然后,当按下后退按钮(即加载上一页)时,您必须检查上一页中的会话值是否存在,如果存在,则将其值提供给页面中的相应控件.
If user hits back button of browser, then he can see the values, but I think that you may have one back button in all pages which redirects it to the previous page.

As a button is clicked, always a post back happens; so the page again reloads with no values.

For your problem, you can store all the values in session variables when you move to next page.
And when back button is pressed(i.e. the previous page loads), you have to check for the existence of the session values in previous page and if they exist, then give their values to appropriate controls in your pages.


要在重新访问页面时恢复这些值,您需要从数据库中加载它们,并使用检索到的值填充输出中的字段.
To restore those values when revisiting a page, you need to load them from the database and populate the fields in the output with the values you retrieved.


这篇关于当用户返回到最后一页时,他在最后一页中提及的所有条目都将被删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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