使用ASP查看上一页的内容 [英] Viewing the contents of Previous Page using ASP

查看:47
本文介绍了使用ASP查看上一页的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..


我想查看上一页的内容,但是当我从第二页移到第一页时,它会被重新加载并且所选内容会丢失。

那么我应该这样做,当我从第2页移到第1页时,所有选定的内容应该保持不变..

其实我尝试使用session并且它正在工作,但它不适用于列表框。

使用Session变量是一个好习惯。


Thanx

Hi..

I want to view the contents of previous page,but when i move from second page to first page,it is reloaded and the selected contents are lost..
So what should i do so that when i move from 2nd page to 1st page,all selected contents should remain same..
Actually i tried using session and it is working,but it doesn''t work with listboxes.
Is it a good practice to use Session variables.

Thanx

推荐答案

您好Vini171285,


使用会话变量来保留控件的值是一种有效且广为接受的方法。有些人会认为最好通过表单或查询字符串将值作为隐藏字段传递,但只要它对你有效,我认为它没问题。


您是否可以打印您尝试使用的代码,以使用会话变量设置列表框的值。它没有理由不应该工作所以它可能只是一个小小的bug。


B博士
Hi Vini171285,

Using session variables to retain the values of your controls is a valid and well accepted method. Some people would argue that it would be better to pass the values as hidden fields through a form or the querystring but as long as it works for you I think it''s fine.

Can you print the code you''re trying to use to set the value of your listbox with a session variable. There''s no reason why it shouldn''t work so it''s probably just a little bug.

Dr B


你好,DrBunchman
Hi, DrBunchman
展开 | 选择 | Wrap | 行号


正如我所说的,在这种情况下是否应该使用会话变量的问题是分歧意见的问题。有一篇文章这里概述了一些专业人士和放大器;使用它们的好处,我认为你必须根据自己的情况自己决定。


要让你的列表框保持它的状态你可以使用以下示例:
As I have said the question of whether you should use session variables in this situation is one that divides opinion. There is an article here that outlines some of the pros & cons of using them and I think you''ll have to make up your own mind based on your circumstances.

To get your list box to maintain it''s state you can use the following example:
展开 | 选择 < span class =codeDivider> | Wrap | 行号


这篇关于使用ASP查看上一页的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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